Professional Documents
Culture Documents
Interfacing
EEE 342
◼ Attendance is important
❑ There are just things that you cannot learn from reading notes
❑ 80% is must to appear in final exam and pass the course
◼ Email protocol
❑ Write your full name and registration ID.
◼ We need to know who you are.
❑ Do not forget to write subject of email
❑ Be professional
◼ Outline
❑ Binary numbers
❑ Number-Base conversions
❑ Octal and hexadecimal numbers
❑ Complements and signed binary numbers
❑ Binary codes
❑ Storage and registers
❑ Binary logic
◼ Examples
❑ 26 letters in the alphabet
❑ 10 decimal digits
◼ Questions to ask
❑ How the numbers are represented in digital systems?
❑ How computer performs basic arithmetic operations?
◼ (24.6)8
◼ Answer = 20.75
◼ (IBC2)16
◼ Answer = 7106
Friday, September 18, 2020 13
Putting It All Together
◼ 291 to octal
◼ Answer = (443)8
◼ 291 to hexadecimal
◼ Answer = (123)16
◼ 0.513 x 8 = 4.104
◼ 0.104 x 8 = 0.832
◼ 0.832 x 8 = 6.656
◼ 0.656 x 8 = 5.248
◼ 0.248 x 8 = 1.984
◼ 0.984 x 8 = 7.872
Friday, September 18, 2020 18
Binary Addition
11 1 1 1
1 carries
1
1 1 1 0 1
+ 1 0 1 1 1
---------------------
1 0 1 0 1 0 0
1
0 1 1 0 10
- 1 0 1 1 1
------------------------
1 1 0 1 1 0
10 1 1 1
X 1 0 1 0
-----------------------
0 0 0 0 0
1 0 1 1 1
0 0 0 0 0
1 0 1 1 1
-----------------------
1 1 1 0 0 1 1 0
Friday, September 18, 2020 21
Converting Between Base 16 and Base 2
▪ Conversion is easy
❑ Determine 4-bit value for each hex digit
▪ Note that there are 24 = 16 different values of four
bits
▪ Easier to read and write in hexadecimal
▪ Representations are equivalent
◼ (B98D)16
◼ Answer = (134615)8
= (1 B B . 2 A)
◼ Algorithm 2
❑ Starting with the least significant bit, copy all of the bits
up to and including the first 1 bit and then
complementing the remaining bits
❑ Example: Find the 2’s complement of (01100101)2
N =01100101
[N] = 1 0 0 1 1 0 1 1
0 1 1 0 0
Add + 0 0 0 0 1
--------------
0 0 1 1 0 1
Step 1: Add binary numbers Add carry 0
Step 2: Add carry to low-order bit
--------------
Final 0 1 1 0 1
Result
0 1 1 0 0
Add + 0 0 0 0 1
--------------
Step 1: Add binary numbers Final 0 0 1 1 0 1
Step 2: Ignore carry bit Result
Ignore
Ignore
Carry
Friday, September 18, 2020 39
2’s Complement Subtraction: Example 2
◼ Let’s compute (13)10 – (5)10
❑ (13)10 = +(1101)2 = (01101)2
❑ (-5)10 = -(0101)2 = (11011)2
◼ Adding these two 5-bit codes
0 1 1 0 1
carry + 1 1 0 1 1
--------------
1 0 1 0 0 0