Title: CS231 (Spring 06) Review Session
1CS231 (Spring 06)Review Session
- Sangkyum Kim
- Feb 17, 2006
2Outline
3A Complete ALU Circuit
4Binary addition by hand
5Adding two bits (half adder)
0 0 0 0 1 1 1 0 1 1 1 10
C XY S X Y X Y X ? Y
6Adding three bits
0 0 0 00 0 0 0 01 0 1 0 01 0
1 1 10 1 0 0 01 1 0 1 10 1 1
0 10 1 1 1 11
(These are the same functions from the decoder
and mux examples.)
7Full adder equations
S ?m(1,2,4,7) X Y Cin X Y Cin X
Y Cin X Y Cin X (Y Cin Y Cin) X
(Y Cin Y Cin) X (Y ? Cin) X (Y ?
Cin) X ? Y ? Cin Cout ?m(3,5,6,7) X Y
Cin X Y Cin X Y Cin X Y Cin (X Y X
Y) Cin XY(Cin Cin) (X ? Y) Cin XY
8Full adder circuit
S X ? Y ? Cin Cout (X ? Y) Cin XY
9A 4-bit adder
10An example of 4-bit addition
A1011 (eleven), B1110 (fourteen)
Woohoo! The final answer is 11001 (twenty-five).
11Hierarchical adder design
12Some other Issues
- Gate Delays
- Ripple Carry Adder
- Carry Lookahead Adder
13Quiz 8.4
For unsigned addition
Based on the 4-bit ripple adder figure. Addition
would be overflow if and only if _____
- (A3 B3 1) Or (A3 ? B3 1 C3 1)
14Outline
15A 2x2 binary multiplier
16Outline
17Converting signed numbers to decimal
- Convert 110101 to decimal, assuming this is a
number in -
- (a) signed magnitude format
-
- (b) 1s complement
-
- (c) 2s complement
-
18Comparing the signed number systems
19A twos complement subtraction circuit
20An adder-subtractor circuit
21Some other Issues
- Signed Overflow
- Sign Extension
- Going from 4-bit to 8-bit numbers
- 0101 (5) ? 0000 0101 (5)
- 1100 (-4) ? 1111 1100 (-4)
22Examples from the past Exams
23Examples from the past Exams
24Examples from the past Exams
25Examples from the past Exams
26Examples from the past Exams
27Examples from the past Exams
28Outline
29MP Example - Problem
The input to your circuit will be the low 4
bits of the ASCII value for the character being
displayed. These values are shown as N3-N0 in the
truth table below. Since you are only
implementing letters A-J, you may assume that the
remaining six 4-bit patterns will never be used,
and so are don't care situations.
Character ASCII N3 N2 N1 N0
A 65 0 0 0 1
B 66 0 0 1 0
J 74 1 0 1 0
30MP Example - Problem
Your circuit will produce seven outputs, one for
each of the seven line segments. We'll name the
outputs T, U, V, W, X, Y, Z, as illustrated right.
A B C D E F G H
I J
31MP Example Truth Table
32MP Example K-Maps
33MP Example K-Map Simplification
34MP Example K-Map Simplification
35MP Example Two Level Implementation
36MP Example NAND Implementation
37MP Example Decoder Implementation
38MP Example Multiplexer Implementation
39THANK YOU!