1 so far we have defined basic building blocks as –inverter, and, and or gates –storage elements...

6
1 So far we have defined basic building blocks as Inverter, AND, and OR gates storage elements (D-Flip-flop) These building blocks can be used to bigger circuits We may give them additional functionality We can either add more inputs or wider inputs, and outputs Or we may perform a more complex operation Or both, like multiplexers, decoders, …. Examples: 3, 4, 5 …. n bit input gates Or you may have multiple bit data inputs • AND, OR, XOR, STORE, READ n-bit data Using building blocks to make bigger circuits

Upload: kerry-gregory

Post on 29-Dec-2015

215 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: 1 So far we have defined basic building blocks as –Inverter, AND, and OR gates –storage elements (D-Flip-flop) These building blocks can be used to bigger

1

• So far we have defined basic building blocks as– Inverter, AND, and OR gates– storage elements (D-Flip-flop)

• These building blocks can be used to bigger circuits• We may give them additional functionality

– We can either add more inputs or wider inputs, and outputs– Or we may perform a more complex operation– Or both, like multiplexers, decoders, ….

• Examples:– 3, 4, 5 …. n bit input gates– Or you may have multiple bit data inputs

• AND, OR, XOR, STORE, READ n-bit data

Using building blocks to make bigger circuits

Page 2: 1 So far we have defined basic building blocks as –Inverter, AND, and OR gates –storage elements (D-Flip-flop) These building blocks can be used to bigger

2

• Flip-flops can be connected to act as a register• All clock signals are connected together to one clock• All flip-flops get different input, each storing one-bit information• A 4-bit register is shown -- It uses 4 D-FFs

– Has a 4 bit inputs and 1 clock and produces 4 bit output

Making a register

C

D Q

P C

D Q

P C

D Q

P C

D Q

P

D0 D1 D2 D3

Clock

Q0 Q1 Q2 Q3

Page 3: 1 So far we have defined basic building blocks as –Inverter, AND, and OR gates –storage elements (D-Flip-flop) These building blocks can be used to bigger

3

• Flip-flops can also be connected to act as a shift register• All clock signals are connected together to one clock• First flip flop gets a new input• Others get input from previous flip-flop• A 4-bit shift register is shown

– It has one bit and one clock input and produces 1 bit output

Making a shift-register

D0

C

D Q

P C

D Q

P C

D Q

P C

D Q

P

Clock

Q0 Q1 Q2 Q3

Page 4: 1 So far we have defined basic building blocks as –Inverter, AND, and OR gates –storage elements (D-Flip-flop) These building blocks can be used to bigger

4

• Design a 1 bit circuit with proper “glue logic” to use it for n-bits– It is called a bit slice– The basic idea of bit slice is to design a 1-bit circuit and then

piece together n of these to get an n-bit component• Previous two examples showed how to use 1-bit components• However, there was no other glue signal or logic• Next, we consider other kind of examples• A half-adder adds two 1-bit inputs• Two half adders can be used to add 3 bits• A 3-bit adder is a full adder

Using 1-bit building blocks to make n-bit circuit

A B S C0 0 0 00 1 1 01 0 1 01 1 0 1

B

C S

A

Page 5: 1 So far we have defined basic building blocks as –Inverter, AND, and OR gates –storage elements (D-Flip-flop) These building blocks can be used to bigger

5

• Two half adders can be used to add 3 bits• n-bit adder can use full adders• n can be arbitrary large

Full adder and multi-bit adder

B

C S

A B

C S

C B

C S

A

Cout

Sum

Cout

Sum

ABC

FullAdder

Cout0Sum0

A0B0Ci

FullAdder

Cout1Sum1

A1B1C1

FullAdder

Cout2Sum2

A2B2C2

FullAdder

Cout3Sum3

A3B3C3

FullAdder

Page 6: 1 So far we have defined basic building blocks as –Inverter, AND, and OR gates –storage elements (D-Flip-flop) These building blocks can be used to bigger

6

• Normally the glue logic is part of 1-bit adder• A basic building block has

– Primary inputs– Primary outputs– Cascading inputs– Cascading outputs

• The cascading signals interact directly with the glue logic• Carry in 1-bit adder is a primary as well as a cascading output• A and B are primary inputs• C is a cascading input• Cout is cascading output• S is primary output

Glue Logic