Sie sind auf Seite 1von 69

Administrative Matters

Chap 1

Course: Digital Circuit Design


Time/Location: 1B3EF-EC115
Instructor:
E-mail: ylli@cs.nctu.edu.tw
URL: http://people.cs.nctu.edu.tw/~ylli/
Office: 441
Office Hours: 4E or make an appointment by @
Teaching Assistants:

: eedc5tgb@gmail.com
: gimball1220@gmail.com
: wengshihyao@gmail.com
: t790704re@gmail.com

Prerequisites: None
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

Administrative Matters
Chap 1

Book:

M. Morris Mano and Michael D. Ciletti, Digital


Design with an Introduction to the VERILOG
HDL, 5th edition, 2013, PEARSON.

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

Course Contents
Chap 1

Course Goals

the fundamental to a digital system,


how a digital system work,
how to design a digital component,
how to optimize a digital component design.

Chap 1. Digital Systems and Binary Numbers


Chap 2. Boolean Algebra and Logic Gates
Chap 3. Gate-Level Minimization
Chap 4. Combinational Logic
Chap 5. Synchronous Sequential Logic
Chap 6. Registers and Counters
Chap 7. Memory and Programmable Logic
Chap 8. Design at the Register Transfer Level (Optional)

Course Contents

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

Grading Policy
Chap 1

Grading

Examinations: 2 exams, 60% (25% and 35%)


Handwriting and programming assignments: 20%
One person per team

Quizzes: 20%
Class participation: bonus
Course Web Site: eCampus
Academic Honesty: Avoiding cheating at all cost.
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

Overview
Chap 1

Integrated Circuits Overview


Digital Systems and Computer Systems
Information Representation
Number Systems [binary, octal and hexadecimal]
Base Conversion
Decimal Codes [BCD (binary coded decimal),
parity]
Alphanumeric Codes

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

Integrated Circuits Overview


Chap 1

System hierarchy

Analog circuits

Digital circuits

AD
converter

Random
(control)
logic

RF
circuit

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

ALU

Digital Design with VERILOG Practice

Integrated Circuits
Chap 1

Integrated Circuits (IC) imply to pack


many components in a circuit.

Small Scale Integration (SSI) A couple of


gates or a flip flop.
Large Scale Integration (LSI) Functional unit
and memory with low computation power and
capability.
Very Large Scale Integration (VLSI) millions
of transistors (electrical switching device).

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

Moores Law
Chap 1

Gordon Moore: co-founder of Intel.


Predicted that the number of transistors per chip would grow
exponentially (double every 18 months).

>9500000 0.25,0.18umCMOS
7500000 0.35um CMOS
3100000 0.8umBiCMOS
1260000 ?
275000 0.8um
134000 HMOS
31000 2um

Source: Intel
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

IC History
Chap 1

Pentium 4

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

VLSI Design Trends


Chap 1

Increasing demands from system level design

System On Chip (SOC)


Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

10

VLSI Design Trends


Chap 1

Digital circuits design trends

Apply computer-aided design tools electrical design


automation (EDA)
Design automation synthesis tools.
Simulation tools.
Verification tools.

Use Hardware Description Language (HDL) to design and


verify circuits at early design stage
Verilog 1983 Developed by Gateway Automation, 1989 Cadence
purchased Gateway Automation, 1995 IEEE Standard 1364
adopted.
VHDL 1983 IEEE Standard 1076.
Why HDL ?
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

11

VLSI Design Flow


Chap 1

(Hardware Description Language)

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

12

VLSI Design Flow


Chap 1
SiO2, Si,
Polisilicon,
Aluminum,
Copper,
Photoresistant,
Plasma,

chip level

cell level

Layout
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Die
Digital Design with VERILOG Practice

IC
13

Digital System
Chap 1

Takes a set of discrete information inputs and discrete


internal information (system state) and generates a set of
discrete information outputs.

Discrete
Inputs

Discrete
Information
Processing
System

Discrete
Outputs

System State
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

14

Types of Digital Systems


Chap 1

No state present

Combinational Logic System


Output = Function(Input)
State present

State updated at discrete times (observe at fixed time)


=> Synchronous Sequential System

State updated at any time (observe all the time)


=>Asynchronous Sequential System

State = Function (State, Input)


Output = Function (State)

Discrete
Inputs

Discrete
Information
Processing
System

Discrete
Outputs

or Function (State, Input)


System State
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

15

Digital System Example:


Chap 1

A Digital Counter (e. g., odometer):


Count Up
Reset

0 0 1 3 5 6 4

Inputs: Count Up, Reset


Outputs: Visual Display
"Value" of stored digits
State:
Synchronous or Asynchronous? Asynchronous
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

16

A Digital Computer Example


Chap 1

Memory

CPU

Control
unit

Inputs:
Keyboard,
mouse, modem,
microphone

Datapath
(Arithmetic & logic op.)

Input/Output

Outputs: CRT,
LCD, modem,
speakers

Synchronous or
Asynchronous?
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

17

Signal
Chap 1

Discrete elements of information (variables) are


represented by physical quantities - signal.
For digital systems, the variable takes on discrete values.
Two level, or binary values are the most prevalent values
in digital systems.
Binary values are represented abstractly by:

digits 0 and 1
words (symbols) False (F) and True (T)
words (symbols) Low (L) and High (H)
and words On and Off.

Binary values are represented by values or ranges of values


of physical quantities
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

18

Signal Examples Over Time


Chap 1

Time
Continuous
in value &
time

Analog
Digital

Discrete in
value &
continuous
in time

Asynchronous

Discrete in
value &
time

Synchronous
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

19

Signal Example Physical Quantity: Voltage


Chap 1

OUTPUT

INPUT
5.0

HIGH

LOW

4.0
3.0
2.0
1.0

HIGH

Threshold
Region
LOW

0.0
Volts
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

20

Why Binary Rather Than Decimal?


Chap 1

5 V each of length 0.5V

Need to recognize more levels more complex


and costly circuits are required
More sensitive to noise - each of length 0.25V
for a given digit representation while
considering noise on the voltages.

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

21

Binary Values: Other Physical Quantities


Chap 1

What are other physical quantities


represent 0 and 1?

CPU Voltage
Disk Magnetic Field Direction
CD Surface Pits/Light
Dynamic RAM Electrical Charge

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

22

Number Systems Representation


Chap 1

Positive radix, positional number systems


A number with base or radix r is represented by
a string of digits:
An - 1An - 2 A1A0 . A- 1 A- 2 A- m 1 A- m
in which 0 Ai < r and . is the radix point.

/A-m: most/least significant digit (msd/lsd).

n-1

The string of digits represents the power series:

i=n-1

(Number)r =

i=0

Ai

j=-1

Aj

r
j

j=-m

(Integer Portion) + (Fraction Portion)


Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

23

Number Systems Examples


Chap 1

Radix (Base)
Digits
0
1
2
3
Powers of 4
Radix
5
-1
-2
-3
-4
-5
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

General

Decimal

Binary

10

0 => r - 1

0 => 9

0 => 1

r0
r1
r2
r3
r4
r5
r -1
r -2
r -3
r -4
r -5

1
10
100
1000
10,000
100,000
0.1
0.01
0.001
0.0001
0.00001

1
2
4
8
16
32
0.5
0.25
0.125
0.0625
0.03125

Digital Design with VERILOG Practice

24

Special Powers of 2
Chap 1

210 (1024) is Kilo, denoted "K"

220 (1,048,576) is Mega, denoted "M"


230 (1,073, 741,824)is Giga, denoted "G"

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

25

Positive Powers of 2
Chap 1

Useful for Base Conversion


Exponent Value
0
1
1
2
2
4
3
8
4
16
5
32
6
64
7
128
8
256
9
512
10
1024
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Exponent Value
11
2,048
12
4,096
13
8,192
14
16,384
15
32,768
16
65,536
17
131,072
18
262,144
19
524,288
20
1,048,576
21
2,097,152

Digital Design with VERILOG Practice

26

Converting Binary to Decimal


Chap 1

To convert to decimal, use decimal arithmetic to


form (digit respective power of 2).
Example:Convert 110102 to N10:
110102 = 1 24 + 1 23 + 1 21 = 2610

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

27

Converting Decimal to Binary


Chap 1

Method 1

Subtract the largest power of 2 (see slide 26) that gives a


positive remainder and record the power.
Repeat, subtracting from the prior remainder and
recording the power, until the remainder is zero.
Place 1s in the positions in the binary result
corresponding to the powers recorded; in all other
positions place 0s.

Example: Convert 62510 to N2

625 512 = 113 = N1 512 = 29


113 64 = 49 = N2 64 = 26
49 32 = 17 = N3 32 = 25
17 16 = 1 = N4 16 = 24
1 1 = 0 = N5 1 = 20
(625)10 = 29 + 26 + 25 + 24 + 20 = (1001110001)2

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

28

Commonly Occurring Bases


Chap 1

Name

Radix

Digits

Binary

0,1

Octal

0,1,2,3,4,5,6,7

Decimal

10

0,1,2,3,4,5,6,7,8,9

Hexadecimal

16

0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

The six letters (in addition to the 10


integers) in hexadecimal represent:

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

29

Numbers in Different Bases


Chap 1

Decimal
(Base 10)
00
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Binary
(Base 2)
00000
00001
00010
00011
00100
00101
00110
00111
01000
01001
01010
01011
01100
01101
01110
01111
10000

Octal
(Base 8)
00
01
02
03
04
05
06
07
10
11
12
13
14
15
16
17
20

Hexadecimal
(Base 16)
00
01
02
03
04
05
06
07
08
09
0A
0B
0C
0D
0E
0F
10

Digital Design with VERILOG Practice

30

Conversion Between Bases


Chap 1

Method 2
To convert from one base to another:
1) Convert the Integer Part
2) Convert the Fraction Part
3) Join the two results with a radix point

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

31

Conversion Details
Chap 1

To Convert the Integral Part:


Repeatedly divide the number by the new radix and save
the remainders. The digits for the new radix are the
remainders in reverse order of their computation. If the
new radix is > 10, then convert all remainders > 10 to
digits A, B,

To Convert the Fractional Part:


Repeatedly multiply the fraction by the new radix and
save the integer digits that result. The digits for the new
radix are the integer digits in order of their computation.
If the new radix is > 10, then convert all integers > 10 to
digits A, B,
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

32

Example: Convert 46.687510 To Base 2


Chap 1

Convert 46 to Base 2
46/2 = 23
23/2 = 11+1/2
11/2 = 5 + 1/2

Remainder = 0
=1
=1

lsd

5/2 = 2 + 1/2
2/2 = 1
1/2 = 0 + 1/2

Remainder = 1
=0
=1
msd

(46)10 = (101110)2

Convert 0.6875 to Base 2:


0.6875 2 = 1.3750
0.3750 2 = 0.7500
0.7500 2 = 1.5000
0.5000 2 = 1.0000
(0.6875)10 = (0.1011)2

integer = 1
=0
=1
=1

msd

lsd

Join the results together with the


radix point: (46.6875)10 = (101110.1011)2
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

33

Additional Issue - Fractional Part


Chap 1

Note that in this conversion, the fractional part


became 0 as a result of the repeated
multiplications.
In general, it may take many bits to get this to
happen or it may never happen.
Example: Convert 0.6510 to N2

0.65 = 0.1010011001001
The fractional part begins repeating every 4 steps
yielding repeating 1001 forever!

Solution: Specify number of bits to right of radix


point and round or truncate to this number.
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

34

Checking the Conversion


Chap 1

To convert back, sum the digits times their


respective powers of r.
From the prior conversion of 46.687510
1011102 = 132 + 016 +18 +14 + 12 +01
= 32 + 8 + 4 + 2
= 46
0.10112 = 1/2 + 1/8 + 1/16
= 0.5000 + 0.1250 + 0.0625
= 0.6875
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

35

Why Do Repeated Division and


Multiplication Work?
Chap 1

46 = 125 + 024 + 123 + 122 + 121 + 020


46/2 = 124 + 023 + 122 + 121 + 120 + 00/2
lsd
1
/2 = 123 + 022 + 121 + 120 + 1/2
1
/2 = 122 + 021 + 120 + 1/2
1
/2 = 121 + 020 + 1/2
/2 = 1120 + 0/2
0
msd

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

36

Why Do Repeated Division and


Multiplication Work?
Chap 1

0.6875 = 12-1 + 02-2 + 12-3 + 12-4


msd
1 0+ 02-1 + 12-2 + 12-3
0.68752 = 12
2 = 02
0 0 + 12-1 + 12-2
1 0 + 12-1
2 = 12
1 0
2 = 12
lsd

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

37

Why Do Repeated Division and


Multiplication Work? (continue)
Chap 1

Convert 46 to Base 2
46/2 = 23 + 0/2
/2 = 11 + 1/2 + 0/22
/2 = 5 + 1/2 + 1/22 + 0/23

/2 = 2 + 1/2 + 1/22 + 1/23 + 0/24


/2 = 1 + 0/2 + 1/22 + 1/23 + 1/24 + 0/25

(46)10 = (101110)2

Convert 0.6875 to Base 2:


0.6875 2 = 1.3750
2 = 10.7500
2 = 101.5000
2 = 1011.0000
(0.6875)10 = (0.1011)2

(46.6875)10 = (101110.1011)2
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

38

Octal (Hexadecimal) to Binary and


Back

Chap 1

Octal (Hexadecimal) to Binary:

Restate the octal (hexadecimal) as three (four)


binary digits starting at the radix point and
going both ways.

Binary to Octal (Hexadecimal):

Group the binary digits into three (four) bit


groups starting at the radix point and going
both ways, padding with zeros as needed in the
fractional part.
Convert each group of three (four) bits to an
octal (hexadecimal) digit.
(010 110 001 101 011.111 100 000 110)2 = (26153.7406)8
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

39

Octal to Hexadecimal via Binary


Chap 1

Convert octal to binary.


Use groups of four bits and convert as
above to hexadecimal digits.
Example: Octal to Binary to Hexadecimal
6 3 5 . 1 7 7 8
(110 011 101. 001 111 111)2
(000110011101.001111111000)2
( 1

D . 3

8 )16

Why do these conversions work?


Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

40

A Final Conversion Note


Chap 1

You can use arithmetic in other bases if you


are careful:
Example: Convert 1011102 to Base 10
using binary arithmetic:
Step 1 101110 / 1010 = 100 r 0110
Step 2
100 / 1010 = 0 r 0100
Converted Digits are 01002 | 01102
or 4 6 10

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

41

Binary Numbers and Binary Coding


Chap 1

Flexibility of representation

Within constraints below, we can assign any binary


combination (called a code word) to any data as long as
data is uniquely encoded.

Information Types

Numeric
Must represent range of data needed
Very desirable to represent data such that simple,
straightforward computation for common arithmetic operations
permitted
Tight relation to binary numbers

Non-numeric
Greater flexibility since arithmetic operations not applied.
Not tied to binary numbers
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

42

Non-numeric Binary Codes


Chap 1

Given n binary digits (called bits), a binary


code is a mapping from a set of represented
elements to a subset of the 2n binary numbers.
Example: A
Color
Binary Number
Red
000
binary code
Orange
001
for the seven
Yellow
010
colors of the
Green
011
rainbow
Blue
101
Indigo
110
Code 100 is
Violet
111
not used
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

43

Complements of Numbers
Chap 1

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

44

Complements of Numbers
Chap 1

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

45

Complements of Numbers
Chap 1

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

46

Complements of Numbers
Chap 1

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

47

Complements of Numbers
Chap 1

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

48

Complements of Numbers
Chap 1

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

49

Signed Binary Numbers


Chap 1

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

50

Signed Binary Numbers


Chap 1

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

51

Signed Binary Numbers


Chap 1

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

52

Signed Binary Numbers


Chap 1

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

53

Signed Binary Numbers


Chap 1

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

54

Binary Codes
Chap 1

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

55

Binary Codes
Chap 1

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

56

Binary Codes
Chap 1

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

57

Binary Codes
Chap 1

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

58

Excess 3 Code and 8, 4, 2, 1 Code


Chap 1

Decimal

Excess 3

8, 4, 2, 1

0011

0000

0100

0111

0101

0110

0110

0101

0111

0100

1000

1011

1001

1010

1010

1001

1011

1000

1100

1111

What interesting property is common to these two


codes?
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

59

Warning: Conversion or Coding?


Chap 1

Do NOT mix up conversion of a decimal


number to a binary number with coding a
decimal number with a BINARY CODE.

1310 = 11012 (This is conversion)


13 0001|0011 (This is coding)

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

60

ASCII Character Codes


Chap 1

American Standard Code for Information Interchange


(Refer to Table 1 -4 in the text)

This code is a popular code used to represent


information such as character-based data. It uses 7bits to represent:

94 Graphic printing characters.


34 Non-printing characters
Some non-printing characters are used for text format
(e.g. BS = Backspace, CR = carriage return)
Other non-printing characters are used for record
marking and flow control (e.g. STX and ETX start
and end text areas).
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

61

ASCII Properties
Chap 1

ASCII has some interesting properties:


Digits 0 to 9 span Hexadecimal values 3016 to 3916 .
Upper case A -Z span 4116 to 5A16 .
Lower case a -z span 6116 to 7A16 .
Lower to upper case translation (and vice versa)
occurs by flipping bit 6.
Delete (DEL) is all bits set, a carryover from when
punched paper tape was used to store messages.
Punching all holes in a row erased a mistake!

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

62

Binary Codes
Chap 1

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

63

Binary Codes
Chap 1

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

64

Binary Codes
Chap 1

Pearson Education, Inc.


Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

65

UNICODE
Chap 1

UNICODE extends ASCII to 65,536


universal characters codes

For encoding characters in world languages


Available in many modern applications
2 byte (16-bit) code words
See Reading Supplement Unicode on the
Companion Website
http://www.prenhall.com/mano
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

66

Error-Detection Codes
Chap 1

Redundancy (e.g. extra information), in the form


of extra bits, can be incorporated into binary code
words to detect and correct errors.
A simple form of redundancy is parity, an extra bit
appended onto the code word to make the number
of 1s odd or even. Parity can detect all single-bit
errors and some multiple-bit errors.
A code word has even parity if the number of 1s
in the code word is even.
A code word has odd parity if the number of 1s in
the code word is odd.
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

67

4-Bit Parity Code Example


Chap 1

Fill in the even and odd parity bits:


Even Parity
Odd Parity
Message - Parity Message - Parity
000 - 1
000 - 0
001 - 0
001 - 1
010 - 0
010 - 1
011 - 1
011 - 0
100 - 0
100 - 1
101 - 1
101 - 0
110 - 0
110 - 1
111 - 1
111 - 0

The codeword "1111" has even parity and the


codeword "1110" has odd parity. Both can be used to
represent 3-bit data.
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

68

Terms of Use
Chap 1

2004 by Pearson Education,Inc. All rights reserved.


The following terms of use apply in addition to the standard
Pearson Education Legal Notice.
Permission is given to incorporate these materials into classroom
presentations and handouts only to instructors adopting Logic and
Computer Design Fundamentals as the course text.
Permission is granted to the instructors adopting the book to post
these materials on a protected website or protected ftp site in
original or modified form. All other website or ftp postings,
including those offering the materials for a fee, are prohibited.
You may not remove or in any way alter this Terms of Use notice
or any trademark, copyright, or other proprietary notice,
including the copyright watermark on each slide.
Return to Title Page
Pearson Education, Inc.
Modified by Y. L. Li, CS/NCTU

Digital Design with VERILOG Practice

69

Das könnte Ihnen auch gefallen