Vous êtes sur la page 1sur 12

ECE 274 - Digital Logic

Lecture 1

Lecture 1

What is digital logic? Digital Hardware Implementing a Digital System Moores Law Design Process of Digital Hardware

What is Digital Logic?


Digital vs. Analog

Digital signal

Discrete Signal that can have one of a finite set of possible values

Counting fingers Fingers = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

Analog signal Continuous Signal that can have one of an infinite number of possible values
Temperature Infinite possibilities

What is Digital Logic?


What is a Digital System?

Digital system

System that takes in digital inputs and generates digital outputs Example: Computer

Digital inputs (letters and numbers from keyboard) Digital output (new numbers or letters stored to a file or display on screen) Cell phones, automobile control engines, TV set top boxes, musical instruments, DVD players, digital cameras, finger print recognition,

Many other digital systems exist

What is Digital Logic?


Digital Circuits and Binary

Digital circuits

Connection of digital components that together compose the digital systems


Digital components

Digital signal with only two possible values -Binary


Typically represented as 0 and 1 One binary digit is a - bit Well only consider binary digital signals

Digital circuit

Digital system

What is Digital Logic?


Digitization

World is mostly analog


Many digital systems convert analog signals to digital signals Many applications changing over to digital implementations (cassette tapes -> MP3s, VHS -> DVD, )

DVD Video Musical Satellites players recorders Portable instruments music players Cell phones Cameras TVs ??? 1995 1997 1999 2001 2003 2005 2007

More and more analog products are becoming digital.


5

What is Digital Logic?


How Do We Encode Data as Binary for Our Digital System

Some inputs inherently binary

Button: not pressed (0), pressed (1)

button

What is Digital Logic?


How Do We Encode Data as Binary for Our Digital System

Some inputs just need encoding in binary

e.g., multi-button input: encode red=001, blue=010, ...

red

blue

green

black

0 0 0

red

blue

green

black

0 0 1

Outputs

Outputs
red blue green black

0 1 0

What is Digital Logic?


How Do We Encode Data as Binary for Our Digital System

Some inputs are analog and need analog-to-digital conversion

Converts electrical signal into binary encoding


analog phenomena Sensors and other inputs electric signal A2D digital data Digital System digital data D2A electric signal

Converts bits back into electrical signal

Actuators and other outputs

digital data

digital data

Measures analog physical phenomena

Converts electrical signal into physical phenomenon

What is Digital Logic?


How Do We Encode Data as Binary for Our Digital System

Example converting an analog signal to a digital signal and viceversa

What is Digital Logic?


Encoding Text: ASCII, Unicode

ASCII: 7- (or 8-) bit encoding of each letter, number, or symbol Unicode: Increasingly popular 16-bit bit encoding

Symbol R S T L N E 0

En coding 1010010 1010011 1010100 1001100 1001110 1000101 0110000 0101110 0001001

S ymbol r s t l n e 9

En coding 1110010 1110011 1110100 1101100 1101110 1100101 0111001 0100001 0100000

Encodes characters from various world languages

.
<tab>

!
<spa ce>

Question: What does this ASCII bit sequence represent? 1010010 1000101 1010011 1010100

R E S

10

What is Digital Logic?


How to Encode Numbers: Binary Numbers

Each position represents a quantity; symbol in position means how many of that quantity

Base ten (decimal)


Ten symbols: 0, 1, 2, ..., 8, and 9 More than 9 -- next position

So each position power of 10

104 103 102 101 100

Base two (binary)


Two symbols: 0 and 1 More than 1 -- next position

So each position power of 2


1 24 23 22 0 21 1 20

Other number representations also exists

Octal, Hexadecimal

Well cover this in Chapter 5

11

What is Digital Logic?


Digitization Benefits

Volts

Analog signal (e.g., audio) may lose quality

lengthy transmission (e.g, cell phone)

3 2 1 0

3 2

Volts

Voltage levels not saved/copied/transmitted perfectly Digitized version enables nearperfect save/cpy/trn. Sample voltage at particular rate, save sample using bit encoding Voltage levels still not kept perfectly But we can distinguish 0s from 1s

original signal
time
01 10 11 10 11

Let bit encoding be: 1 V: 01 2 V: 10 3 V: 11

1 received signal 0 time How fix -- higher, lower, ?

a2d
1 0 time
01 10 11 10 11

digitized signal

1 0 time Can fix -- easily distinguish 0s and 1s, restore

d2a
3 Volts 2 1 0 time

Digitized signal not perfect re-creation, but higher sampling rate and more bits per encoding brings closer.

12

What is Digital Logic?


Digitization Benefits

Digitized audio can be compressed


e.g., MP3s CD can hold about 20 songs uncompressed, but about 200 compressed

Example compression scheme: 00 --> 0000000000 01 --> 1111111111 1X --> X


0000000000 0000000000 0000001111 1111111111

Compression also done on digitized pictures (jpeg), movies (mpeg), and more Digitization has many other benefits too

00 00 10000001111 01

13

Digital Hardware
Standard Chips

How do we implement these systems? (Digital Hardware)

Standard Chips

Commonly used circuits Small amount of circuitry Performs simple function ICs interconnected to realize larger functionality

Part Number 7400 7402 7432 7447 7485

Description Quad 2-Input NAND Gate Quad 2-Input NOR Gate Quad 2-Input OR Gate BCD to 7-Segment Decoder/Driver 4-Bit Magnitude Comparator 4-Bit Binary Ripple Counter D-Type Flip-Flop with Reset

Assortment of 7400series ICs

7493 74273

14

Digital Hardware
Programmable Logic Devices (PLDs)

Programmable Logic Devices

Very general underlying structure that can be configured to perform a variety of tasks Most can be programmed multiple times Programmed by the end user rather than when manufactured Common type of PLD -- FPGAs

Spartan 3 Die Photo

Field-Programmable Gate Array Work with these in the lab

Spartan 3 FPGA Board


15

Digital Hardware
Custom-Designed Chips

Custom-Designed Chips

Created specifically to implement a certain task Very expensive millions of dollars Time consuming - months

Custom IC Design

Silicon Wafer
16

Digital Hardware
Microprocessors

Microprocessor

Programmable digital device End user writes a program/software to specify its functionality

Silicon Wafer

Individual IC (die)

Pentium processor

Pentium processor Die Photo


17

Digital Hardware
Many other choices exist

Other choices exist


Variety of processors exist ASICs (Application-Specific Integrated Circuits) CPLD (Complex Programmable Logic Devices) PLA (Programmable Logic Arrays) GAL (Generic Array Logic) System-on-a-chip

8051 ($1-10)

PIC ($1-5)

Pentium (>$100)

18

Implementing a Digital System


Programming Microprocessors vs. Designing Digital Circuits

Build a system to detect motion at night


Build system using microprocessor Build system using a custom digital circuit

Desired motion-at-night detector

Programmed microprocessor

Custom designed digital circuit

19

Implementing a Digital System


Microprocessor: Software Implementation Circuit Description: using a microprocessor Inputs: 2 sensors (one light, one motion) Outputs: 1 signal to lamp Functional Description: Lamp illuminated when it is dark and motion is detected.
motion sensor

microprocessor a f

lamp

void main() { while(1) { f = a && !b; } }

b light sensor

20

Implementing a Digital System


Custom Circuit: Hardware Implementation Circuit Description: digital design Inputs: 2 sensors (one light, one motion) Outputs: 1 signal to lamp Functional Description: Lamp illuminated when it is dark and motion is detected.
motion sensor a f lamp

b light sensor

custom circuit

21

Implementing a Digital System


Microprocessors: Trouble in Paradise With microprocessors so readily available, why would anyone ever need to design new digital circuits?

When analyzing needs for a particular system: Software may be too slow May be too much circuitry than needed Can be costly for simple circuits Power hungry

22

Implementing a Digital System


Process Analysis: Microprocessor vs. Digital Circuit
Sample digital camera task execution times (in seconds) on a microprocessor versus a digital circuit.

Digital Camera Task Read Compress Store

Microprocessor 5 8 1

Custom digital circuit 0.1 0.5 0.8

23

Implementing a Digital System


Partitioning: Possible Digital Camera Implementations

Design Partitioning

Deciding which tasks to implement on the microprocessor and which to implement as a custom digital circuit

Digital camera implemented with: (a) a microprocessor (b) custom circuits (c) a combination of custom circuits and a microprocessor

24

Implementing a Digital System


Partitioning: Possible Digital Camera Implementations
Image Sensor Image Sensor Image Sensor Microprocessor (Read, Compress, and Store) Read circuit Compress circuit Read circuit Compress circuit

Memory

Memory (b) custom circuits

Store circuit

Memory

Microprocessor (Store)

(a) a microprocessor

(c) a combination of custom circuits and a microprocessor

=5+8+11 =24 sec

=.1+.5+.8 =1.4 sec

=.1+.5+1 =1.6 sec

Good compromise

Sample digital camera task execution times (in seconds) on a microprocessor versus a digital circuit
Task Read Compress Store 5 8 1 Microprocessor Custom Digital Circuit 0.1 0.5 0.8

Q: How long for each implementation option?

25

Moores Law
The prediction

Interesting trend in digital design


Gordon Moore: co-founder of Intel. Predicted that number of transistors per chip would grow exponentially (double every 18 months). Exponential improvement in technology is a natural trend: steam engines, dynamos, automobiles.

26

Moores Law
The trend follows the prediction

Courtesy of Intel

27

Moores Law
Example
To perform function X, we require this much area 18 months later, this much area 18 months later, this much area 18 months later, this much area 18 months later, this much area 18 months later, this much area 18 months later, this much area 18 months later, this much area 18 months later, this much area 18 months later, this much area 18 months later, this much area 18 months later, this much area 18 months later, this much area

This trend observed in 1970s continues today. Expected to continue for several more decades
28

Digital Design
Shrinking area requirement

~20 years

One view point -- same functionality requires less area

29

Moores Law
Supercomputer in a pencil tip

Cray 1A Supercomputer

Cray 1A

Fastest computer in the world in 1976 Cost - $10 million dollars (1976 $s) Used for atmospheric research, physical simulations, etc. ~1 million transistors

Today - approaching 1 billion transistors per square centimeter (65 nm)


1 million transistors (Cray 1) Modern chip 1 billion transistors


1 cm

1 million transistors (Cray 1): 0.1 mm2 Cost - $1s

1 cm

30

Moores Law
Enabling advances in technology

Smart Dust

Millimeter scale Includes sensors, microprocessors, wireless communication, power supply Costs dollars, even just cents, each Electronically tracked and instructed to deliver medicine to specific location Swallowing the pill and the instrument Pump controls amount of medicine based on body temperature and pH
http://www.templehealth.org/capsule/a pril_22_05/april2205_news03.htm
Courtesy of Joe Kahn

Smart Pills

iPills micropump, sensors, and medicine

Other uses of tiny computers in 10 years?

Image: "Smart dust" particles self-assembled on drops of oil in water. The microscopic particles are nanostructured flakes of porous silicon that spontaneously assemble, orient, sense, and report on their local environment. UCSD, 2003.

31

Moores Law
Same size, more functionality

~20 years

Another view point -- same area more functionality ~ 4000x more

Available today

Pentium 4 Extreme Edition (178 million) Xilinx FPGA (1 billion) Geforce 6800 Ultra (222 million)

32

Moores Law
Lots of transistors need help

Available today

Pentium 4 Extreme Edition (178 million) Xilinx FPGA (1 billion) Geforce 6800 Ultra (222 million)

Need CAD (Computer-Aided Design) Tools to help developers

33

Design Process of Digital Hardware


High-level view

Basic design loop

Iterative process

Design concept

Initial design

Simulation

Redesign

Design correct? Yes Successful design

No

34

Design Process of Digital Hardware


Digital Hardware Design

More complex design loop

Design concept

Digital hardware products usually involve multiple chips or components Digital camera is a simplified example
Design one block

Partition B Design one block C Design interconnection between blocks Functional simulation of complete system No D

Correct? Yes Physical mapping Timing simulation

Correct? Yes Implementation

No

35

Summary

Digital systems surround us


Inside computers Inside huge variety of other electronic devices (embedded systems) Encoding analog signals to digital can provide many benefits

Digital systems use 0s and 1s

e.g., audio -- higher-quality storage/transmission, compression, etc.

Encoding integers as 0s and 1s: Binary numbers

Microprocessors (themselves digital) can implement many digital systems easily and inexpensively

But often not good enough -- need custom digital circuits

Design process is iterative

36

Vous aimerez peut-être aussi