Floating Point Representation and Digital Logic Lecture 11 CS301 - - PowerPoint PPT Presentation

floating point representation and digital logic
SMART_READER_LITE
LIVE PREVIEW

Floating Point Representation and Digital Logic Lecture 11 CS301 - - PowerPoint PPT Presentation

Floating Point Representation and Digital Logic Lecture 11 CS301 Administrative Daily Review of todays lecture w Due tomorrow (10/4) at 8am Lab #3 due Friday (9/7) 1:29pm HW #5 assigned w Due Monday 10/8 at 5pm Program


slide-1
SLIDE 1

Floating Point Representation and Digital Logic

Lecture 11 CS301

slide-2
SLIDE 2

Administrative

  • Daily Review of today’s lecture

w Due tomorrow (10/4) at 8am

  • Lab #3 due Friday (9/7) 1:29pm
  • HW #5 assigned

w Due Monday 10/8 at 5pm

  • Program #1 assigned

w Due Thursday, 10/18 at 11:59pm

  • Read Appendix C.1-C.3, C.5
slide-3
SLIDE 3

Digital Logic

(How do we construct a processor?)

slide-4
SLIDE 4

Multi-Million Transistor Chips

Intel Core i7 Extreme Edition - 731 million transistors, 263 mm^2 area

slide-5
SLIDE 5

MOS Semiconductor Transistors

P-type silicon: Excess positive charges (electron holes) N-type silicon: Excess negative charges (electrons) Oxide: Insulator Gate: Metal pad In this state, current (electrons) cannot flow between source and drain – switch is OPEN

Silicon Bulk (p-type)

+ + + + + + + + + + + + + + + + + + + + + + +

e- e- e- e- e- e- e- e- e-

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

e- e- e- e- e-

Source

e- e- e- e-

Drain Gate

n-type Si n-type Si Source Wire Gate Wire

Oxide

Drain Wire

slide-6
SLIDE 6

MOS Semiconductor Transistors

Silicon Bulk (p-type)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

e- e- e- e- e-

Source

e- e- e- e-

Drain Gate

n-type Si n-type Si Source Wire Gate Wire

Oxide

+5V

+ + + + + + + + +

e- e- e-

Place a positive charge on the gate wire (gate = +5V) The gate’s positive charge attracts negatively-charged electrons This row of electrons forms a channel connecting the Source and Drain – Current can flow – Switch is CLOSED

Drain Wire

e- e- e- e- e- e- e- e-

slide-7
SLIDE 7

Transistors

  • Transistors

w Emits 0 or 1 when on

  • r off

w Can connect transistors in series

  • r parallel to create

larger building blocks called gates

Pull-up pMOS transistor Pull-down nMOS transistor

GND +5V A Z

CMOS Inverter created from two transistors

slide-8
SLIDE 8

Digital Logic

  • Voltages represent values

w Logically false - 0 w Logically true - 1

  • Values are complements or inverses
slide-9
SLIDE 9

Gates: Basic Building Blocks:

  • Depending on organization of transistors, different

inputs give specific outputs

  • Basic gates equivalent to boolean operators

w INVERTER or NOT, ! w AND, && w OR, ||

  • Combinational logic

w Outputs based on inputs w No memory A A A A • B B A A + B B

slide-10
SLIDE 10

Truth Tables

  • Functionality fully

specified by truth table

  • n inputs

w n input columns w 2n input rows

  • m outputs

w m output columns

A Z 1 1 A B Z 1 1 1 1 1 A B Z 1 1 1 1 1 1 1

NOT AND OR

slide-11
SLIDE 11

Combinational Logic

  • Gates can be

combined in

w Series w Parallel

  • Any combination of

both possible

A B Y Z 1 1 1 1 1 1 1

A A A B Y Z

slide-12
SLIDE 12

Other Important Gates

  • NAND
  • NOR

A B Z 1 1 1 1 1 1 1 A B Z 1 1 1 1 1

A A B B A A + B B

slide-13
SLIDE 13

Universal Gates

  • Any other gate can be constructed

from some arrangement of universal gates

w Examples: NAND / NOR

  • Important because frequently less

expensive to design chips with “homogeneous” gates

slide-14
SLIDE 14

Universal Gates
 (NAND)

  • NOT

A A AA 1 1 1

A A A

slide-15
SLIDE 15

Universal Gates
 (NAND)

  • NOT
  • AND

A A AA 1 1 1

A A A

A B AB 1 1 1 1 1

slide-16
SLIDE 16

Universal Gates
 (NAND)

  • NOT
  • AND

A A AA 1 1 1 A B AB AB 1 1 1 1 1 1 1 1

A A A A A B B

slide-17
SLIDE 17

Universal Gates
 (NAND)

  • OR

A B A+B 1 1 1 1 1 1 1

slide-18
SLIDE 18

Universal Gates
 (NAND)

  • OR

A B A+B AB 1 1 1 1 1 1 1 1 1 1

A B AB

slide-19
SLIDE 19

For Fun: XOR

A B A⊕B 1 1 1 1 1 1

slide-20
SLIDE 20

For Fun: XOR

A B A⊕B 1 1 1 1 1 1

slide-21
SLIDE 21

Few Final Notes

  • Gates can have more than 2 inputs

w Generally keep number small due to electrical engineering issues

  • Circuits that create current computers

are constructed from these basic gates

slide-22
SLIDE 22

Equivalent

  • Truth tables
  • Circuit
  • Boolean algebra expression

Truth tables are great for evaluating when circuit

  • r Boolean expression evaluate to true
slide-23
SLIDE 23

Combinatorial Logic: Multiplexor

23

Really a selector: One of the inputs is selected by the control C = (A * ~S) + (B * S)

slide-24
SLIDE 24

Combinational Logic:
 Multiplexor

n:1 MUX 2n inputs n control 1 output n control lines select which of 2n inputs goes to output

n possible input lines requires ceiling(log2n) control lines. Equivalently, n control lines with 2n input lines.

slide-25
SLIDE 25
slide-26
SLIDE 26

1-bit MUX

AS + BS

slide-27
SLIDE 27

Combinational Logic:
 De-Multiplexor

n:1 DEMUX 2n outputs n control 1 input n control lines select which of 2n outputs input goes to

slide-28
SLIDE 28

1 to 2 De-multiplexor

slide-29
SLIDE 29

Combinational Logic:
 Decoder

n control lines select which of 2n outputs set to 1 2n outputs n control

slide-30
SLIDE 30

1 to 8 De-multiplexor

slide-31
SLIDE 31

Combinational Logic:
 Encoder

One of 2n inputs set to 1. Output encodes which input set to 1. 2n inputs n bit output

slide-32
SLIDE 32

4 to 2 Encoder

slide-33
SLIDE 33

8 to 3 Encoder

33

slide-34
SLIDE 34

Combinational Logic

  • Comparator

w Given 2 inputs, sets output to 1 if inputs match

slide-35
SLIDE 35
slide-36
SLIDE 36

Combinational Logic

  • Half-Adder

w No carry in

slide-37
SLIDE 37

Combinational Logic

  • Half-Adder

w No carry in

A B Sum Carry Out 1 1 1 1 1 1 1

A⊕B AB

slide-38
SLIDE 38

1-bit Full Adder

  • Three inputs:

w A w B w Cin

  • Two outputs:

w Sum = (A⊕B) ⊕ Cin w Cout = AB + (A⊕B) Cin

slide-39
SLIDE 39

Ripple Carry Adder

  • Construct n-bit

adder with n 1-bit adders

  • Delay is problem
  • Faster alternative:

w Carry-lookahead adder