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
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Which of the transistors below are on?

Submit your answer on menti.com with code 24 34 75

  • 5V

5V 6V 2V 4V 5V 9kΩ 1kΩ 9kΩ 1kΩ

A B C D

slide-2
SLIDE 2

ENGR 40M, Lecture 10:

From logic gates to computers

Steven Bell

17 July 2016

slide-3
SLIDE 3

Two levels of thinking about transistors

Logic-level Voltage/circuit level

An NMOS turns on when VGS > Vth A PMOS turns on when VGS < -Vth Transistor only "knows" voltages across its pins. 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

slide-4
SLIDE 4

Time taken on homework:

<= 1 hour <= 2 hours > 3 hours <= 3

slide-5
SLIDE 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 overflow/underflow Take a keyboard apart (and figure out how it works).

slide-6
SLIDE 6

Binary numbers

slide-7
SLIDE 7

Convert the following decimal numbers to binary:

4, 19, 63, 256

Convert the following binary numbers to decimal:

10001, 10101, 00111, 11111111

slide-8
SLIDE 8

0000 0011 0001 0010 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

binary integer

  • verflow!
slide-9
SLIDE 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

slide-10
SLIDE 10

0000 0011 0001 0010 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6 -7 -8

binary unsigned signed signed overflow unsigned overflow

slide-11
SLIDE 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

slide-12
SLIDE 12

What is the largest signed number you can represent? Smallest (most negative) signed number?

If you have 8 bits:

slide-13
SLIDE 13

Casting from one data type to another doesn't change the bits.

unsigned char x = 253; char y = x; print(y); char x = -1; int y = x; print(y);

When you add more bits, the number shouldn't change...

slide-14
SLIDE 14

Building an adder

slide-15
SLIDE 15

xkcd.com/571

slide-16
SLIDE 16

Breaking break:

Keyboards!