digitalteknik datorarkitektur v ren 2009
play

Digitalteknik & Datorarkitektur vren 2009 Rkna med grindar - PowerPoint PPT Presentation

Digitalteknik & Datorarkitektur vren 2009 Rkna med grindar Frelsning 2 mndag 23 mars karl.marklund@it.uu.se Gates and Boolean Algebra Some logical functions for two variables. x y x AND y x OR y x XOR y 0 0 0 0 0 0 1


  1. Digitalteknik & Datorarkitektur våren 2009 Räkna med grindar Föreläsning 2 måndag 23 mars karl.marklund@it.uu.se

  2. Gates and Boolean Algebra

  3. Some logical functions for two variables. x y x AND y x OR y x XOR y 0 0 0 0 0 0 1 0 1 1 1 0 0 1 1 1 1 1 1 0 Hur många olika sådana funktioner finns det för två variabler?

  4. Some logical functions for two variables. x y x AND y x OR y x XOR y 0 0 0 0 0 0 1 0 1 1 1 0 0 1 1 1 1 1 1 0 Varje funktion definieras entydigt av sin kolumn i tabellen.. Varje kolumn utgörs av ett fyra bitars binärt tal... Hur många olika fyra bitars tal finns det?

  5. Det finns 2 4 = 16 olika!

  6. Hur adderar vi tal?

  7. Hur adderar vi binära tal? 1 0 1 + 1 1 1 -------- ? ? ?

  8. Hur adderar vi binära tal? överskjutande 4-tal Minnessiffra – Carry överskjutande 8-tal (överskjutande 2-tal) 1 (c) 1 1 1 1 1 1 0 1 (x) 1 0 1 1 0 1 + 1 1 1 (y) + 1 1 1 + 1 1 1 -------- ------- ------- 0 0 0 1 1 0 0 Summanderna är på tre bitar och resultatet kan då bli fyra bitar. Har vi endast möjlighet att lagra tre bitar finns alltså risk för overflow .

  9. Half Adder C out = ? Inputs Output Row x y c out s S = ? 0 0 0 0 0 1 0 1 0 1 2 1 0 0 1 3 1 1 1 0

  10. Half Adder C out = x AND y Inputs Output Row x y c out s S = x XOR y 0 0 0 0 0 1 0 1 0 1 2 1 0 0 1 3 1 1 1 0

  11. Logisim Demo!

  12. When both are "on", the two Programmable Water jets collide, going vertically down to the "U" piece, that collects the water. When just one of them is "on"... So, we have two Boolean operations in just one device… … and it’s a half adder. In other words, it's a In other words, an XOR gate. AND gate. Paulo Blikstein

  13. http://www.blikstein.com/paulo/projects/project_water.html

  14. Vill man inte bygga en dator av vatten funkar det bra med reläer. http://web.cecs.pdx.edu/~harry/Relay/

  15. Transistor Triod Relay Alla dessa tekniker kan användas för att konstruera logiska kretstar... till exempel för att addera två tal. Water Gate

  16. 6 + 3 = ? = 4 + 2 = 2 2 + 2 1 6 1 1 0 + 0 1 1 --------------------------- ? ? ? = 2 + 1 = 2 1 + 2 0 3

  17. 6 + 3 = ? = 4 + 2 = 2 2 + 2 1 6 1 1 0 + 0 1 1 --------------------------- ? ? ? = 2 + 1 = 2 1 + 2 0 3

  18. Carry Out från den ena enbits-additionen blir carry in för nästa… 1 0 0 (c) Overflow 1 1 0 (x) + 0 1 1 (y) ------------------------- (1) 0 (1)0 (0)1 Inputs Outputs Vi skriver det Row Comment som en x y c in c out s sanningstabell 0 0 0 0 0 0 0 + 0 + 0 = 00 2 1 0 0 1 0 1 0 + 0 + 1 = 01 2 2 0 1 0 0 1 0 + 1 + 0 = 01 2 3 0 1 1 1 0 0 + 1 + 1 = 10 2 4 1 0 0 0 1 1 + 0 + 0 = 01 2 5 1 0 1 1 0 1 + 0 + 1 = 10 2 6 1 1 0 1 0 1 + 1 + 0 = 10 2 7 1 1 1 1 1 1 + 1 + 1 = 11 2

  19. Values of the inputs when Carry Out equals 1. Inputs All inputs in a Row c out x y c in row can be represented as 3 0 1 1 1 a minterm . In a minterm each 5 1 0 1 1 input variable appearc once, 6 1 1 0 1 either as the variable itself or 7 1 1 1 1 as the inverse.

  20. Values of the inputs when Carry Out equals 1. Inputs Row c out minterms x y c in 3 0 1 1 1 !xyc in 5 1 0 1 1 x!yc in 6 1 1 0 1 xy!c in 7 1 1 1 1 xyc in C out = !xyc in + x!yc in + xy!c in + xyc in Row 3 5 6 7 In a minterm , each input variable, A, B or C appears once, either as the variable itself or as the inverse. Each minterm corresponds to exactly one entry (row) in the truth table .

  21. Values of the inputs when Carry Out equals 1. Inputs Row c out minterms x y c in 3 0 1 1 1 !xyc in 5 1 0 1 1 x!yc in 6 1 1 0 1 xy!c in 7 1 1 1 1 xyc in C out = !xyc in + x!yc in + xy!c in + xyc in Row 3 5 6 7 C out = c in (!xy + x!y) + xy(!c in + c in ) ??? ???

  22. Values of the inputs when Carry Out equals 1. Inputs Row c out minterms x y c in 3 0 1 1 1 !xyc in 5 1 0 1 1 x!yc in 6 1 1 0 1 xy!c in 7 1 1 1 1 xyc in C out = !xyc in + x!yc in + xy!c in + xyc in Row 3 5 6 7 C out = c in (!xy + x!y) + xy(!c in + c in ) !xy + x!y = x XOR y !c in + c in = 1

  23. Values of the inputs when Carry Out equals 1. Inputs Row c out minterms x y c in 3 0 1 1 1 !xyc in 5 1 0 1 1 x!yc in 6 1 1 0 1 xy!c in 7 1 1 1 1 xyc in C out = !xyc in + x!yc in + xy!c in + xyc in Logisim C out = c in (!xy + x!y) + xy(!c in + c in ) DEMO C out = c in (x XOR y) + xy

  24. Aha! Sum is one only one when an odd number of inputs are one. Inputs Row S minterms x y c in 1 0 0 1 1 !x!yc in 2 0 1 0 1 !xy!c in 4 1 0 0 1 x!y!c in 7 1 1 1 1 xyc in Logisim DEMO S = x XOR y XOR c in

  25. 1 bit half adder 1 bit half adder

  26. A one bit Adder wiht Carry In and Carry out.

  27. When multiple full adders are used with the carry ins and carry outs chained together then this is called a ripple carry adder because the correct value of the carry bit ripples from one bit to the next.

  28. Tutorial: Mer om grindar och andra grundläggande komponenter.

  29. Uppgift: Lär dig mer om grindar, multiplexrar, demultiplexrar adderare och register..

  30. Utmaning: Konstruera ett kodlås. Skall kunna sätta en 4-siffrig kod. Skall signalera när rätt kod trykts in. Ok, om vi först sätter koden till 0127 När vi trycker in 3, 4, 5 ... händer ingenting. Om vi fortsätter med 0, 1 händer inget. Men när vi fortsätter med 2, 7 så öppnas låset.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend