engsci 232 computer systems lecture 5: synchronous circuits

12
ENGSCI 232 Computer Systems Lecture 5: Synchronous Circuits

Upload: lucius-williamson

Post on 02-Jan-2016

20 views

Category:

Documents


0 download

DESCRIPTION

ENGSCI 232 Computer Systems Lecture 5: Synchronous Circuits. The building block of synchronous circuits, such as counters and shift registers, is the flip-flop - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: ENGSCI 232 Computer Systems Lecture 5: Synchronous Circuits

ENGSCI 232 Computer Systems

Lecture 5: Synchronous Circuits

Page 2: ENGSCI 232 Computer Systems Lecture 5: Synchronous Circuits

°The building block of synchronous circuits, such as counters and shift registers, is the flip-flop

°A flip-flop is a device which can be ‘latched’ into either of two possible states and stay in that state until a specified set of input conditions occur.

Page 3: ENGSCI 232 Computer Systems Lecture 5: Synchronous Circuits

°We can build a latch by using 2 NAND gates with appropriate coupling.

Page 4: ENGSCI 232 Computer Systems Lecture 5: Synchronous Circuits

°Clocks

° An asynchronous system allows states to change whenever one or more inputs change. This is generally harder to design and fault-find than a synchronous system. We will consider synchronous systems in this lecture.

° Here the exact times at which outputs can change state is determined by the ‘clock’ signal.

° The clock is normally a regular rectangular waveform and is applied to many component within a digital system.

° A flip-flop may be designed to trigger on either the rising or falling edge of the clock pulse (ie when the clock is changing from 0 ->1 or 1->0).

Page 5: ENGSCI 232 Computer Systems Lecture 5: Synchronous Circuits

°D-Type Flip-Flop

Page 6: ENGSCI 232 Computer Systems Lecture 5: Synchronous Circuits

JK-type flip-flops

° Similar to D flip-flop, but has two data inputs

J

K

Q

Q

S

R

J K Qn+1

0 0 Qn

0 1 11 0 01 1 Qn

clock

Page 7: ENGSCI 232 Computer Systems Lecture 5: Synchronous Circuits

Building a Counter using flip-flops

° To count electrical pulses, feed signal into clock input

° Chain a flip-flop output to next flip-flop clock to add extras bits to your counter

D

C

Q

Q

D

C

Q

Q

D

C

Q

Q

D

C

Q

Qinput clock

Q0 Q1 Q2 Q3

input clock

Q0

Q1

Q2

binarybase10

negative edge triggeredflip-flops

Page 8: ENGSCI 232 Computer Systems Lecture 5: Synchronous Circuits

Shift Registers

° We often need to shift bits left, eg to ...

° We do this using a shift register (eg built from flip-flops)

D

C

Q

Q

D

C

Q

Q

D

C

Q

Q

D

C

Q

Qinput clock

Q0 Q1 Q2 Q3

data

Step Q3 Q2 Q1 Q0 D1 0 0 0 0 02 13 04 05 16 17 08 09 010 0

Page 9: ENGSCI 232 Computer Systems Lecture 5: Synchronous Circuits

Registers

° Registers store working data

• think of as a small scratch-pad of memory

• fast access

° Data moves between registers on a ...

• use a system .......... to ensure synchronisation

° Can use N flip-flops to make an N-bit register (just like memory)

° Add digital logic to perform further functions

• load preset data

• shift left

• shift right

• shift by n bits left or right

• count

Page 10: ENGSCI 232 Computer Systems Lecture 5: Synchronous Circuits

Registers and databuses

° Different registers can grab data from a common data bus

- at different times

Register 1 Register 2

ALUopALU

Result Register Status Register

ControlLoad 1

Load 2

Load result

Data Bus (32 bits wide) MemoryStorage

Page 11: ENGSCI 232 Computer Systems Lecture 5: Synchronous Circuits

° Real vs Ideal Components

° Because voltages cannot change instantaneously, all real devices have propogation delays where the actual output lags behind that expected theoretically. While the voltage is changing, we have voltages that are not 0V or 5V that are often input to a second device. A device has some arbitrary cutoff (eg 2.5V) above which the input is interpreted as a true and below which as false.

° For example, consider an inverter. When input goes 0V -> 5V, output goes 5V -> 0V but NOT instantly. When the input goes 5V -> 0V, output goes 0V -> 5V but NOT instantly.

Page 12: ENGSCI 232 Computer Systems Lecture 5: Synchronous Circuits

Timing and Control by CPU

° CPU generates control signals to co-ordinate operations such as memory read write

Address

Data

32

Write

AddressDecoder

R5

R4

R3

R2

R1

R032

CPU

ClkRead