Elements of Computing Systems, Nisn & Schocken, MIT Press www.idc.c.il/tecs Usge nd Copyright Notice: Boolen Logic Copyright 2005 Nom Nisn nd Shimon Schocken This presenttion contins lecture mterils tht ccompny the textook The Elements of Computing Systems y Nom Nisn & Shimon Schocken, MIT Press, 2005. We provide oth PPT nd PDF versions. The ook we site, www.idc.c.il/tecs, fetures 13 such presenttions, one for ech ook chpter. Ech presenttion is designed to support 3 hours of clssroom or self-study instruction. You re welcome to use or edit this presenttion s you see fit for instructionl nd noncommercil purposes. If you use our mterils, we will pprecite it if you will include in them reference to the ook s we site. If you hve ny questions or comments, you cn rech us t tecs.t@gmil.com Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 1
Boolen lger Some elementry Boolen opertors: Not(x) And(x,y) Or(x,y) Nnd(x,y) Boolen functions: x y z f ( x, y, z) = ( x+ y) z x Not(x) Not(x) 0 1 1 0 x y Or(x,y) Or(x,y) 0 0 0 0 1 1 1 0 1 1 1 1 x y And(x,y) And(x,y) 0 0 0 0 1 0 1 0 0 1 1 1 x y Nnd(x,y) Nnd(x,y) 0 0 1 0 1 1 1 0 1 1 1 0 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 1 1 1 1 0 Functionl expression VS truth tle expression Importnt result: Every Boolen function cn e expressed using And, Or, Not. Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 2
All Boolen functions of 2 vriles Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 3
Boolen lger Given: Nnd(,), flse We cn uild: Not() = Nnd(,) true = Not(flse) And(,) = Not(Nnd(,)) George Boole, 1815-1864 ( A Clculus of Logic ) Or(,) = Not(And(Not(),Not())) Xor(,) = Or(And(,Not()),And(Not(),))) Etc. Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 4
Gte logic Gte logic gte rchitecture designed to implement Boolen function Elementry gtes: Composite gtes: Importnt distinction: Interfce (wht) VS implementtion (how). Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 5
Gte logic Interfce Xor Clude Shnnon, 1916-2001 0 0 0 0 1 1 1 0 1 1 1 0 Implementtion Not And ( Symolic Anlysis of Rely nd Switching Circuits ) Or Not And Xor(,) = Or(And(,Not()),And(Not(),))) Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 6
Circuit implementtions AND gte 0 0 0 0 1 0 1 0 0 1 1 1 OR gte 0 0 0 0 1 1 1 0 1 1 1 1 power supply power supply c 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 c AND (,,c) c AND AND From computer science perspective, physicl reliztions of logic gtes re irrelevnt. Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 7
Project 1: elementry logic gtes Given: Nnd(,), flse Build: Nnd(,) Nnd(,) 0 0 1 0 1 1 1 0 1 1 1 0 Not() =... true =... And(,) =... Or(,) =... Mux(,,sel) =... Etc. - 12 gtes ltogether. Why these prticulr 12 gtes? Since They re commonly used gtes They provide ll the sic uilding locks needed to uild our computer. Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 8
Multiplexer sel sel 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 0 1 1 0 1 1 1 1 1 Mux sel 0 1 Proposed Implementtion: sed on Not, And, Or gtes. Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 9
Exmple: Building n And gte And And.cmp 0 0 0 0 1 0 1 0 0 1 1 1 Contrct: When running your.hdl on our.tst, your. should e the sme s our.cmp. And.hdl And.tst CHIP CHIP And And { IN IN,, ; ; OUT OUT ; ; // // implementtion missing missing } lod lod And.hdl, And.hdl, put-file And., And., compre-to And.cmp, And.cmp, put-list ; ; set set 0,set 0,set 0,evl,put; set set 0,set 0,set 1,evl,put; set set 1,set 1,set 0,evl,put; set set 1, 1, set set 1, 1, evl, evl, put; put; Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 10
Building n And gte Interfce: And(,) = 1 exctly when ==1 And And.hdl CHIP CHIP And And { IN IN,, ; ; OUT OUT ; ; // // implementtion missing missing } Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 11
Building n And gte Implementtion: And(,) = Not(Nnd(,)) And.hdl CHIP CHIP And And { IN IN,, ; ; OUT OUT ; ; // // implementtion missing missing } Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 12
Building n And gte Implementtion: And(,) = Not(Nnd(,)) Nnd x in Not And.hdl CHIP CHIP And And { IN IN,, ; ; OUT OUT ; ; // // implementtion missing missing } Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 13
Building n And gte Implementtion: And(,) = Not(Nnd(,)) NAND x in NOT And.hdl CHIP CHIP And And { IN IN,, ; ; OUT OUT ; ; Nnd( Nnd( =,, =,, = x); x); Not(in Not(in = x, x, = ) ) } Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 14
Hrdwre simultor (demonstrting Xor gte construction) HDL progrm test script Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 15
Hrdwre simultor HDL progrm Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 16
Hrdwre simultor HDL progrm put file Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 17
Project mterils Project 1 on the course we site And.hdl, And.tst, And.cmp files Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 18
Project 1 tips Red Chpter 1 of the ook Downlod the ook s softwre suite Go through the hrdwre simultor tutoril Do Project 0 (optionl) You re in usiness. Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 19
End notes: Cnonicl representtion Truth tle of the function s (, m, w) = ( m+ w) Cnonicl form: s (, m, w) = m w+ mw+ mw Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 20
End notes: Cnonicl representtion (cont.) s (, m, w) = ( m+ w) m w nd or s s (, m, w) = m w+ mw+ mw m w nd nd or s nd Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 21
End notes: Progrmmle Logic Device for 3-wy functions c nd legend: ctive fuse lown fuse 8 nd terms connected to the sme 3 inputs. or f(,,c) nd single or term connected to the puts of 8 nd terms _ PLD implementtion of f(,,c)= c + c (the on/off sttes of the fuses determine which gtes prticipte in the computtion) Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 22
Perspective Ech Boolen function hs cnonicl representtion The cnonicl representtion is expressed in terms of And, Not, Or And, Not, Or cn e expressed in terms of Nnd lone Ergo, every Boolen function cn e relized y stndrd PLD consisting of Nnd gtes only Mss production c nd Universl uilding locks, unique topology. or f(,,c) Gtes, neurons, toms, nd Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 23
End note: universl uilding locks, unique topology nd c. or f(,,c) nd Elements of Computing Systems, Nisn & Schocken, MIT Press, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 24