which of the transistors below are on
play

Which of the transistors below are on? 9k 9k A B 5V 5V 1k 1k - PowerPoint PPT Presentation

Which of the transistors below are on? 9k 9k A B 5V 5V 1k 1k -5V D C 6V 2V 4V Submit your answer on menti.com with code 24 34 75 ENGR 40M, Lecture 10: From logic gates to computers Steven Bell 17 July 2016 Two levels of


  1. Which of the transistors below are on? 9k Ω 9k Ω A B 5V 5V 1k Ω 1k Ω -5V D C 6V 2V 4V Submit your answer on menti.com with code 24 34 75

  2. ENGR 40M, Lecture 10: From logic gates to computers Steven Bell 17 July 2016

  3. Two levels of thinking about transistors Voltage/circuit level Transistor only "knows" voltages across its pins. An NMOS turns on when V GS > V th A PMOS turns on when V GS < -V th Logic-level Assume : NMOS source → Vdd, PMOS source → Gnd Assume : Inputs are HIGH (1, Vdd) or LOW (0, Gnd) Then: An NMOS turns on when input is high A PMOS turns on when input is low

  4. Time taken on homework: <= 1 hour <= 2 hours <= 3 > 3 hours

  5. By the end of today, you should be able to: Represent numbers using binary, with 2's complement for negative values Explain the various datatypes in Arduino, and predict over fl ow/under fl ow Take a keyboard apart (and fi gure out how it works).

  6. Binary numbers

  7. Convert the following decimal numbers to binary: 4, 19, 63, 256 Convert the following binary numbers to decimal: 10001, 10101, 00111, 11111111

  8. over fl ow! 0000 1111 0001 0 15 1 1110 0010 2 14 0011 1101 3 13 binary integer 4 12 1100 0100 5 11 0101 1011 6 10 9 7 0110 8 1010 0111 1001 1000

  9. To write a negative number in 2's complement: Write the positive number in binary Flip all the bits (1 → 0, 0 → 1) Add 1 (with all the appropriate carries) To convert negative 2's complement to decimal, Flip all the bits (1 → 0, 0 → 1) Add 1 (with all the appropriate carries) Write the number in decimal

  10. unsigned over fl ow 0000 1111 0001 0 15 1 1110 0010 0 2 14 1 -1 2 -2 0011 1101 3 13 3 -3 binary unsigned 4 4 12 -4 1100 0100 signed 5 -5 5 11 6 -6 -7 -8 0101 1011 7 6 10 9 7 0110 8 1010 0111 signed over fl ow 1001 1000

  11. Convert the following decimal numbers to binary, using 8-bit 2's complement: -1, -12, -128, 4 Convert the following 8-bit 2's complement binary numbers to decimal: 1000 _ 0011, 0000 _ 1011, 1111 _ 1100

  12. If you have 8 bits: What is the largest signed number you can represent? Smallest (most negative) signed number?

  13. Casting from one data type to another doesn't change the bits . unsigned char x = 253; char y = x; print(y); When you add more bits, the number shouldn't change ... char x = -1; int y = x; print(y);

  14. Building an adder

  15. xkcd.com/571

  16. Breaking break: Keyboards!

Recommend


More recommend