Designing a 3-Bit Adder/Subtractor Circuit with Overflow
School
Iowa State University**We aren't endorsed by this school
Course
CPR E 281
Subject
Electrical Engineering
Date
Dec 12, 2024
Pages
2
Uploaded by ProfessorBookMule27
En Subtraction: 7 -3 =4 Addition: 4 + (-7) = -3 11001 51 Ignore 0 + 00100 11001 011101 \('L \(‘ \(o add /5€ Yo 3-bit adder Clop —P [ - “ Sy Tonare o Ol wv ~l Yn-1 Add /Sub Wwo control Xn-1 % Q W, v ] 1 Yy \ Y f A4 [ -bit adder w2 J e Sn-1 5 5 w3 H >_ — . A s Overflow Detection: 5-bits s Add /Sub Carry, control in J cary out a) Full Adder (FA) 1 t [ ] ] EAENE Y xn\/y‘ AR AR B3 A3 B2 A2 B1 A1 BO A0 o 5-bit adder l l l l l l Ss S ) 5 ) ‘ [T T 1 Ful [ €3 | Fun | C2 | Fun [ €1 | Ful |cin Adder Adder Adder Adder l/ overtlow Carry S3 s2 s1 so | - - out X4Y484+X4Y484 Clock, — ;i =Xx®y:® ¢ S 1 Civ1 =(Xx;®DYy;)C;i + X, y; ci+1 b) 4-bits Ripple Carry Adder (a) Let A=Az A1 A¢ and B=Bz B1 Bo be two 3-bit binary numbers in 2’s complement representation. You are given three full-adders, one NOT gate, and seven XOR gates. Your task is to design a circuit that can perform two different arithmetic operati The operation is selected by one of the inputs to this circuit that is called S. When S=0 the 3-bit result R= Rz R1 Ry is equal to A-B. Alternatively, when S=1 the result is B-A. The circuit must also detect if an overflow has occurred. Draw the wiring diagram for your circuit below. Clearly label all inputs, outputs, and pins. B2 A’fl» Py 4 e Cl sl s HA c Xi e— Y; —— HA c Cirl (a) Block diagram c; \‘_\ L " A 3-to-8 decoder using two 2-to-4 dec A 1-to-4 demultiplexer built with a 2-to-4 decoder with enable "o " BOY Yo "1 ! i b4l N p23 po) w 1 "2 e » 0 D: 0 0| . A 4-to-1 multiplexer & Lo nb— | . o P built using a 2-to-4 decoder w, Vs . p——— = D % P » " Nr—— H) 5 p— A barrel shifter circuit D Bl S| Sg Y3 Y2V Yo |,_|Di y3 Wy Wy W, W, D g (1) w; wi w; w? 1 : " d , F2, F1, and Fo. The equations 1o woowe W w for the outputs are: RS S H H H H F2=F1=(S1&S0)[($1 &%) (@) Tt tale Hold / Shift-Right Circuit , o w3 w wy o 1 ] .. [ 4-bit input fi 7 fi —7 fi —7 s The Adder / Subtractor Sl_% | yu— — 0 ["’3 "2 " WO] 0 9 sub o | ’ | \+—|+—\+—‘+—‘ | Vi X Yo X Ys X Yo X Vs X Yo X2 Yy X Yo X y V- y Ay ’ " " " Pl o7 Pl o7 Pl 7 Pl 7 X v T LI I I O O O . i 1. Label all inputs, output circuit. (7p) J.l J.l -]._I- ll J.L -LL J.l b 0 it | | | 1 v 0 Yo ", > I [ys Y2 ) yo] k I_ : En wy wy Yo ¥y Yy V3 put 0 1 00 1000 " ; o , 101 0100 i " 0"_|} Y2 110 001 0 Rel 1 1.1 00 01 e LS o 0 00 0 0 4 00—130— »3 i o ,—_)E >— overflow (a) Truth table (b) Graphical symbol carry 281 CPU 0 T T x indicates that it does not matter what the value of this variable is for this row of the truth table