






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The encoding of larger values as binary numbers and the addition of unsigned numbers using binary representation. It includes examples of converting decimal numbers to binary using both the subtraction and division methods, as well as examples of binary addition with carry. The document also touches on the use of other number bases, such as octal and hexadecimal, and their conversion to and from binary.
Typology: Study notes
1 / 12
This page cannot be seen from the preview
Don't miss anything!







Lecture 11 – Chapter 5
ECE 274 - Digital Logic
Inputs to digital systems not limited to a single 1 or 0
Previously, we said our digital system deal with 1s and 0s only
b
a F = a + b
average(5, 14)
ECE 274 - Digital Logic
Base ten (Decimal)
Ten symbols: 0, 1, 2, ..., 8, and 9 More than 9 -- next position So each position power of 10 Nothing special about base 10 -- used because we have 10 fingers
523 = (5 * 10^2 ) + (2 * 10^1 ) + (3 * 10^0 ) = (5 * 100) + (2 * 10) + (3 * 1)
Q: How much?
Base two (Binary)
So each position power of 2
ECE 274 - Digital Logic
Range of integer binary number can represent depends on bits used
Most-significant bit (MSB)
Least-significant bit (LSB)
Convenient to group bits together
ECE 274 - Digital Logic
What is the decimal equivalent?
110 2 =? Decimal
2 2 2 1 2 0
1 1 0
110 2 = (1 * 2 2 ) + (1 * 2^1 ) + (0 * 2^0 )
= (1 * 4) + (1 * 2) + (0 * 1)
= 6 (^10)
Remaining quantity: 12
1 32 is too much
(^0 1) 16 is too much
(^0 0 1) 12 – 8 = 4
(^0 0 1 1) 4 - 4 = 0 DONE
0 answer
0 1 1 0 0
Subtraction method
Then, we have a new remaining quantity, and we start again (from the present binary position) Stop when remaining quantity is 0
ECE 274 - Digital Logic
Binary Number
quotient (6) is greater than 0, keep dividing by 2
Decimal Number
divide by 2
insert remainder
insert remainder
insert remainder
quotient (3) is greater than 0, keep dividing by 2
quotient (1) is greater than 0, keep dividing by 2
quotient (0) is 0, we can conclude that 12 is 1100 in binary
insert remainder
Division Method
ECE 274 - Digital Logic
Binary Number
quotient (5) is greater than 0, keep dividing by 2
Decimal Number
divide by 2
insert remainder
insert remainder
insert remainder
quotient (2) is greater than 0, keep dividing by 2
quotient (1) is greater than 0, keep dividing by 2
quotient (0) is 0, we can conclude that 10 is 1010 in binary
insert remainder
Let’s try another example
using the Division Method
octal binary
Other bases available
Octal
Range from 0 to 7 Useful shorthand for binary
Group binary numbers in 3’s Replace with corresponding octal digit
Replace octal digit with corresponding 3 bits denoting same value
Symbols = (0, 1, 2, 3, 4, 5, 6, 7)
ECE 274 - Digital Logic
hex binary 1000 1001 1010 1011 1100 1101 1110 1111
hex bina ry
Symbols = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F)
Hex
Group binary numbers in 4’s Replace with corresponding hex digit
Replace hex digit with corresponding 4 bits denoting same value
ECE 274 - Digital Logic
Modern computer represent numbers using 32 or 64 bits
Introduced simple numbers
Later we’ll consider
What if we want to bigger numbers (i.e. multiple bit numbers)?
truth table with 26 rows = 64 rows
truth table with 28 rows = 256 rows
10000 8000 6000 4000 2000 0 1 2 3 4 5 N
6 7 8
Transistors
Exponential Growth for Two-Level Adder Implementation
ECE 274 - Digital Logic
Instead we can consider each column separately
possible carry bit from previous row
carry out sum
operand 2
carry in
based on this observation we can create a truth table
ECE 274 - Digital Logic
Let’s create circuit to perform addition
Special type of circuit – full adder
s
c (^) i+
x y
Circuit
ci
Graphical Symbol
x
ci+1 s
y ci
A:
B:
Create component for each column
x FA c (^) i+1 s
y (^) c (^) i
x FA c (^) i+1 s
y (^) c (^) i
x FA c (^) i+1 s
y (^) c (^) i x FA c (^) i+1 s
y (^) c (^) i
ECE 274 - Digital Logic
ci+1s 3 s 2 s 1 s 0
c (^) i
Graphical Symbol
4-bit adder
Called a carry-ripple adder
Can easily build any size adder
co
xyc (^) i
FA
xyc (^) i
xyc (^) i
A 0 B 0 ci
xyc (^) i
c (^) i+1 s c (^) i+1 s c (^) i+1 s c (^) i+1 s
ECE 274 - Digital Logic
0111 + 0001
Wrong answer -- something wrong? No -- just need more time for carry to ripple through the chain of full adders.
xy ci FA
xyci
xyci
xyc (^) i
ci+1 s c (^) i+1 s ci+1 s ci+1 s 0 0 0
0 0 1 1 0 Output after 2ns (1 FA delay)
xyci FA
xyci FA
xyci FA
xyci
c (^) i+1 s ci+1 s ci+1 s ci+1 s
ci+
c i
s 7 s 6 s 5 s (^4)
8-bit adder
s 3 s 2 s 1 s (^0)
ci+
c (^) i
s 7 s 6 s 5 s (^4)
9-bit adder
s 3 s 2 s 1 s (^0)
s (^8)
ci+
c (^) i
s 7 s 6 s 5 s (^4)
9-bit adder
s 3 s 2 s 1 s (^0)
s (^8)
ci+
c (^) i
to display
8-bit adder
Weight Sensor
Adjustment Knob
(^0 ) 6 2 543
7
Weight Adjuster
s 7 s 6 s 5 s 4 s 3 s 2 s 1 s (^0)