Files
G4G0-1/Semester 1/Computer Systems Internals & Linux/Week 2/Week 2 Computer Systems Internals & Linux.md
2024-01-15 20:14:10 +00:00

2.5 KiB

Lecture 1 (12:00)

Addition

Binary Base 2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0
Decimal 128 64 32 16 8 4 2 1
Int1 0 0 0 1 0 1 0 1
Int2 0 0 0 0 0 1 0 1
Overflow 1 1
Result 0 0 0 1 1 0 1 0
Decimal 26

Multiplication

Binary Base 2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0
Decimal 128 64 32 16 8 4 2 1
Int1 0 0 0 0 0 0 1 1
Factor 1
Result 0 0 0 0 0 1 1 0
Decimal 6
  • Multiply binary shift to the left. Example is x2
  • Multiplying by non powers of 2, split and multiply.
Binary Base 2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0
Decimal 128 64 32 16 8 4 2 1
Int1 0 0 0 1 0 0 1 1
Factor Decimal 6
Result 1 0 1 0 0 1 1 0 0
Result 2 0 0 1 0 0 1 1 0
Overflow 1 1
Total 0 1 1 1 0 0 1 0
Denary 114
  • Example of 19x6, which simplifies into (19x4) + (19x2), which is shown above by doing two binary shifts and adding them together.

Workshop 1 (11:00)

CSV Manipulation

  1. How many users are in the file?
  2. Use a combination of head and tail to find the 5th line of the file
  3. how many users use /bin/sh as their shell and how many use /bin/bash