Lctur Roadmap ombinational Logic EE 55 Digital Systm Dsign with VHDL Lctur Digital Logic Rrshr Part ombinational Logic Building Blocks Basic Logic Rviw Basic Gats D Morgan s Law ombinational Logic Building Blocks Multiplrs Dcodrs, Dmultiplrs Encodrs, Priority Encodrs rithmtic circuits ROM. Implmnting combinational logic using ROM. Tristat burs. 2 Ttbook Rrncs ombinational Logic Rviw Stphn Brown and Zvonko Vransic, Fundamntals o Digital Logic with VHDL Dsign, 2 nd or 3 rd Edition haptr 2 Introduction to Logic ircuits (2.2. only) haptr 6 ombinationalircuit Building Blocks (6.6.5 only) OR your undrgraduat digital logic ttbook (chaptrs on combinational logic) Basic Logic Rviw som slids modiid rom: S. Dandamudi, Fundamntals o omputr Organization and Dsign 3 Ruls Basic Logic Gats (2input vrsions) I you bliv that you know a corrct answr, plas rais your hand I will slct on or mor studnts (indpndntly whthr an answr givn by th irst studnt is corrct or incorrct) Plas, idntiy yoursl by irst nam and giv an answr orrct answr = bonus point 5 6
Basic Logic Gats Gnralizd Simpl logic gats ND à i on or mor inputs is OR à i on or mor inputs is NND = ND + NOT i on or mor inputs is NOR = OR + NOT i on or mor input is XOR à i an odd numbr o inputs is XNOR à i an vn numbr o inputs is NND and NOR gats rquir wr transistors than ND and OR in standard MOS Functionality can b prssd by a truth tabl truth tabl lists output or ach possibl input combination Numbr o Functions Numbr o unctions With N logical variabls, w can din 2 2N unctions Som o thm ar usul ND, NND, NOR, XOR, Som ar not usul: Output is always Output is always Numbr o unctions dinition is usul in proving compltnss proprty 7 omplt St o Gats omplt sts st o gats is complt i w can implmnt any logic unction using only th typ o gats in th st Som ampl complt sts {ND, OR, NOT} Not a minimal complt st {ND, NOT} {OR, NOT} {NND} {NOR} Minimal complt st complt st with no rdundant lmnts. NND as a omplt St Proving NND gat is univrsal 9 Logic Functions ltrnativ Rprsntations o Logic Function Logic unctions can b prssd in svral ways: Truth tabl Logical prssions Graphical schmatic orm HDL cod Eampl: Majority unction Output is on whnvr majority o inputs is W us 3input majority unction Truth tabl B F HDL cod: Logical prssion orm F = B + B + Graphical schmatic orm F <= ( ND B) OR (B ND ) OR ( ND ) ; 2 2
Boolan lgbra Boolan idntitis Nam ND vrsion OR vrsion Idntity. = + = omplmnt. = + = ommutativ. y = y. + y = y + Distribution. (y+z) = y+z + (y. z) = (+y) (+z) Idmpotnt. = + = Null. = + = Boolan lgbra (cont d) Boolan idntitis (cont d) Nam ND vrsion OR vrsion Involution = ( ) bsorption. (+y) = + (. y) = ssociativ. (y. z) = (. y). z + (y + z) = ( + y) + z d Morgan (. y) = + y ( + y) =. y (d Morgan s law in particular is vry usul) 3 ltrnativ symbols or NND and NOR Driving Equivalnt Eprssions Using NND gats Gt an quivalnt prssion B + D = ( B + D) Using d Morgan s law B + D = ( ( B). ( D) ) an b gnralizd Eampl: Majority unction B + B + = (( B). (B ). () ) 5 6 Majority Function Using Othr Gats Majority unction ombinational Logic Building Blocks Som slids modiid rom: S. Dandamudi, Fundamntals o omputr Organization and Dsign S. Brown and Z. Vransic, "Fundamntals o Digital Logic" 7 3
Multiplrs 2to Multiplr log 2n slction inputs s s w w w w n inputs output (a) Graphical symbol (b) Truth tabl multiplr n binary inputs (binary input = bit input) log 2 n binary slction inputs binary output Function: on o n inputs is placd onto output alld nto multiplr w s w (c) Sumoproducts circuit w s w (d) ircuit with transmission gats 9 Sourc: Brown and Vransic 2 to Multiplr Multibit to Multiplr s s s s s s s s w w w 2 w 3 w w w 2 w 3 w w w 2 w 3 w w w 2 w 3 (a) Graphic symbol (b) Truth tabl (a) Graphic symbol (b) Truth tabl s w s w w 2 w 3 Whn drawing schmatics, can draw multibit multiplrs Eampl: bit to multiplr inputs (ach bits) output ( bits) 2 slction bits an also hav multibit 2to mus, 6to mus, tc. Sourc: Brown and Vransic (c) ircuit 2 22 bit to Multiplr Dcodrs s s w(7) w(7) w2(7) w3(7) (7) n inputs w y n 2 n w 2 n outputs s s w w w 2 w 3 = s s w(6) w(6) w2(6) w3(6) s s w() w() w2() w3() (6) () n bit to multiplr is composd o ight [bit] to multiplrs Enabl En Dcodr n binary inputs 2 n binary outputs Function: dcod ncodd inormation I nabl=, on output is assrtd high, th othr outputs ar assrtd low I nabl=, all outputs assrtd low Otn, nabl pin is not ndd (i.. th dcodr is always nabld) alld nto2 n dcodr an considr n binary inputs as a singl nbit input an considr 2 n binary outputs as a singl 2 n bit output Dcodrs ar otn usd or RM/ROM addrssing y 23 2
2to Dcodr En w w y 3 y 2 y y (a) Truth tabl w y 3 w y 2 y En y (b) Graphical symbol Problm Show how to implmnt a dcodr that rcognizs th ollowing rangs o a 6bit addrss, and gnrats th corrsponding nabl signals,,2,3: w w y y y 2 For in: FFF: DDFFF: EEFFF: FFFFF: ssrt 2 3 y 3 En Sourc: Brown and Vransic (c) Logic circuit 25 Dmultiplrs to Dmultiplr log 2n slction inputs input n outputs Dmultiplr binary input n binary outputs log 2n binary slction inputs Function: placs input onto on o n outputs, with th rmaining outputs assrtd low alld ton dmultiplr losly rlatd to dcodr an build ton dmultiplr rom log 2nton dcodr by using th dcodr's nabl signal as th dmultiplr's input signal, and using dcodr's input signals as th dmultiplr's slction input signals. 27 2 Encodrs to2 Encodr 2 n inputs w 2 n w y y n n outputs w 3 w 2 w w y y (a) Truth tabl Encodr 2 n binary inputs n binary outputs Function: ncods inormation into an nbit cod alld 2 n ton ncodr an considr 2 n binary inputs as a singl 2 n bit input an considr n binary output as a singl nbit output Encodrs only work whn actly on binary input is qual to w w y w 2 y w 3 29 (b) ircuit 3 5
Priority Encodrs to2 MSB Priority Encodr 2 n inputs w 2 n w y n n outputs y z "valid" output Priority Encodr 2 n binary inputs n binary outputs binary "valid" output Function: ncods inormation into an nbit cod basd on priority o inputs alld 2 n ton priority ncodr Priority ncodr allows or multipl inputs to hav a valu o '', as it ncods th input with th highst priority (MSB = highst priority, LSB = lowst priority) "valid" output indicats whn priority ncodr output is valid Priority ncodr is mor common than an ncodr w 3 w 2 w w y y z 3 32 bit Unsignd Multiplir bit Signd Multiplir a * c b U a * c b S 33 3 Unsignd vs. Signd Multiplication Logical Shit Right Unsignd 5 5 225 Signd >> L (3) (2) () () (3) (2) () 35 36 6
rithmtic Shit Right Fid Rotation >> (3) (2) () () (3) (3) (2) () <<< (3) (2) () () (2) () () (3) 37 3 bit Variabl Rotator Lt Rad Only Mmory (ROM) 3 B <<< B m DDR ROM DOUT n 39 Implmnting rbitrary ombinational Logic Using ROM Tristat Bur X5 X X3 X2 X Y DDR DOUT 5 ROM (a) tristat bur Z Z (c) Truth tabl = = (b) Equivalnt circuit 2 7
Four typs o Tristat Burs (a) (b) (c) (d) 3