1 / 22

MineCraft Logic Gates  Using redstone circuits,

inst.eecs.berkeley.edu/~cs61c UC Berkeley CS61C : Machine Structures Lecture 26 – Combinational Logic Blocks. Senior Lecturer SOE Dan Garcia www.cs.berkeley.edu/~ddgarcia. MineCraft Logic Gates  Using redstone circuits,

Download Presentation

MineCraft Logic Gates  Using redstone circuits,

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. inst.eecs.berkeley.edu/~cs61cUC BerkeleyCS61C : Machine StructuresLecture 26 – Combinational Logic Blocks Senior Lecturer SOE Dan Garcia www.cs.berkeley.edu/~ddgarcia MineCraft Logic Gates Using redstone circuits, which are “structures that can be built to active or control mechamisms”, you can create all the logic gates using MineCraft. minecraft.gamepedia.com/Tutorials/Basic_Logic_Gates

  2. Review • Use this table and techniques we learned to transform from 1 to another

  3. Today • Data Multiplexors • Arithmetic and Logic Unit • Adder/Subtractor

  4. Data Multiplexor (here 2-to-1, n-bit-wide) “mux”

  5. N instances of 1-bit-wide mux How many rows in TT?

  6. How do we build a 1-bit-wide mux?

  7. 4-to-1 Multiplexor? How many rows in TT?

  8. Is there any other way to do it? Hint: NCAA tourney! Ans: Hierarchically!

  9. Arithmetic and Logic Unit • Most processors contain a special logic block called “Arithmetic and Logic Unit” (ALU) • We’ll show you an easy one that does ADD, SUB, bitwise AND, bitwise OR

  10. Our simple ALU

  11. Administrivia • How did you find project 2? • Hated it • Disliked it • Neutral • Liked it • Loved it

  12. Truth-table, then determine canonical form, then minimize and implement as we’ve seen before Look at breaking the problem down into smaller pieces that we can cascade or hierarchically layer Adder/Subtracter Design -- how?

  13. Adder/Subtracter – One-bit adder LSB…

  14. Adder/Subtracter – One-bit adder (1/2)…

  15. Adder/Subtracter – One-bit adder (2/2)…

  16. + + + N 1-bit adders  1 N-bit adder b0 What about overflow? Overflow = cn?

  17. # ± Whatop? What about overflow? • Consider a 2-bit signed # & overflow: • 10 = -2 + -2 or -1 • 11 = -1 + -2 only • 00 = 0 NOTHING! • 01 = 1 + 1 only • Highest adder • C1 = Carry-in = Cin, C2 = Carry-out = Cout • No Cout or Cin NO overflow! • Cin, and Cout NO overflow! • Cin, but no Cout A,B both > 0, overflow! • Cout, but no Cin A,B both < 0, overflow!

  18. # ± What about overflow? • Consider a 2-bit signed # & overflow: 10 = -2 + -2 or -111 = -1 + -2 only00 = 0 NOTHING!01 = 1 + 1 only • Overflows when… • Cin, but no Cout A,B both > 0, overflow! • Cout, but no Cin A,B both < 0, overflow!

  19. + + + Extremely Clever Subtractor XOR serves asconditional inverter!

  20. Peer Instruction • Truth table for mux with 4-bits of signals has 24 rows • We could cascade N 1-bit shifters to make 1 N-bit shifter for sll, srl 12 a) FF b) FT c) TF d) TT

  21. Peer Instruction Answer Truth table for mux with 4-bits of signals controls 16 inputs, for a total of 20 inputs, so truth table is 220 rows…FALSE We could cascade N 1-bit shifters to make 1 N-bit shifter for sll, srl … TRUE • Truth table for mux with 4-bits of signals is 24 rows long • We could cascade N 1-bit shifters to make 1 N-bit shifter for sll, srl 12 a) FF b) FT c) TF d) TT

  22. “And In conclusion…” • Use muxes to select among input • S input bits selects 2S inputs • Each input can be n-bits wide, indep of S • Can implement muxes hierarchically • ALU can be implemented using a mux • Coupled with basic block elements • N-bit adder-subtractor done using N 1-bit adders with XOR gates on input • XOR serves as conditional inverter

More Related