Elements of Computing Systems, Nisn & Schocken, MIT Press, 2005 www.idc.c.il/tecs Chpter 1: Boolen Logic Usge nd Copyright Notice: 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. 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 for instructionl nd non-commercil purposes. If you use our mterils, we will pprecite it if you will include in them reference to the ook s we site. And, if you hve ny comments, you cn rech us t tecs.t@gmil.com Elements of Computing Systems, Nisn & Schocken, MIT Press, 2005, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 1
Alger Bool Pewne elementrne opertory oolowskie: Not(x) And(x,y) Or(x,y) Nnd(x,y) Funkcje oolowskie: x y z f ( x, y, z) ( x y) z x Not(x) 0 1 1 0 x y Or(x,y) 0 0 0 0 1 1 1 0 1 1 1 1 x y And(x,y) 0 0 0 0 1 0 1 0 0 1 1 1 x y Nnd(x,x) 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 Wyrżenie funkcji z pomocą tlicy prwdy Postć knoniczn: Kżd funkcj oolowsk może yć wyrżon z pomocą opertorów And, Or, Not. Elements of Computing Systems, Nisn & Schocken, MIT Press, 2005, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 2
Wszystkie funkcje 2-rgumentowe oolowskie Elements of Computing Systems, Nisn & Schocken, MIT Press, 2005, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 3
Alger Bool Dne: Nnd(,), flse 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, 2005, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 4
Brmki logiczne Brmk logiczn urządzenie fizyczne implementujące funkcję oolowską Brmki elementrne: Brmki złożone: Dw skłdniki: interfejs orz implementcj. Elements of Computing Systems, Nisn & Schocken, MIT Press, 2005, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 5
Brmki logiczne Interfejs Xor Clude Shnnon, 1916-2001 0 0 0 0 1 1 1 0 1 1 1 0 Implementcj 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, 2005, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 6
Implementcj przez owody elektryczne 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 Z perspektywy informtyk sposó fizycznej relizcji rmek logicznych jest ez znczeni. Elements of Computing Systems, Nisn & Schocken, MIT Press, 2005, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 7
Projekt 1: rmki elementrne Dne: Nnd(,), flse Zudowć: Nnd(,) 0 0 1 0 1 1 1 0 1 1 1 0 Not() =... true =... And(,) =... Or(,) =... Mux(,,sel) =... Etc. w sumie 12 rmek. Elements of Computing Systems, Nisn & Schocken, MIT Press, 2005, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 8
Multiplekser 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 Implementcj w oprciu o rmki Not, And, Or. Elements of Computing Systems, Nisn & Schocken, MIT Press, 2005, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 9
Przykłd: Budow rmki And z pomocą symultor Plik And.cmp Umow: And 0 0 0 0 1 0 1 0 0 1 1 1 Łdując plik.hdl do pliku.tst, wygenerowc plik wynikowy. identyczny z plikiem.cmp. Plik And.hdl Plik And.tst CHIP And { IN, ; OUT ; } // implementtion missing lod And.hdl, put-file And., compre-to And.cmp, put-list ; set 0,set 0,evl,put; set 0,set 1,evl,put; set 1,set 0,evl,put; set 1, set 1, evl, put; Elements of Computing Systems, Nisn & Schocken, MIT Press, 2005, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 10
Budow rmki And z pomocą symultor Interfejes: And(,) = 1 tylko, gdy ==1 And Plik And.hdl CHIP And { IN, ; OUT ; } // implementtion missing Elements of Computing Systems, Nisn & Schocken, MIT Press, 2005, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 11
Budow rmki And z pomocą symultor Implementcj: And(,) = Not(Nnd(,)) Plik And.hdl CHIP And { IN, ; OUT ; } // implementtion missing Elements of Computing Systems, Nisn & Schocken, MIT Press, 2005, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 12
Building n And gte Implementtcj: And(,) = Not(Nnd(,)) Nnd x in Not Plik And.hdl CHIP And { IN, ; OUT ; } // implementtion missing Elements of Computing Systems, Nisn & Schocken, MIT Press, 2005, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 13
Budow rmki And z pomocą symultor Implementtcj: And(,) = Not(Nnd(,)) NAND x in NOT Plik And.hdl CHIP And { IN, ; OUT ; } Nnd( =, =, = x); Not(in = x, = ); Elements of Computing Systems, Nisn & Schocken, MIT Press, 2005, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 14
Symultor progrm HDL Skrypt testowy digrm rmki And And Or Elements of Computing Systems, Nisn & Schocken, MIT Press, 2005, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 15
Symultor progrm HDL Elements of Computing Systems, Nisn & Schocken, MIT Press, 2005, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 16
Symultor progrm HDL Plik wynikowy Elements of Computing Systems, Nisn & Schocken, MIT Press, 2005, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 17
Wskzówki do projektu 1 Przeczytj plik Uzupełnieni1.pdf Poierz plik instlcyjny symultor Poierz instrukcję hrdwre-simultor.pdf Elements of Computing Systems, Nisn & Schocken, MIT Press, 2005, www.idc.c.il/tecs, Chpter 1: Boolen Logic slide 18