SlideShare a Scribd company logo
Chapter 1 1
COE 200
Introduction
Chapter 1 2
Outline
 Course Introduction
•Course Information
•Textbook
•Grading
•Important Dates
•Course Outline
Chapter 1 3
Course Information
 Instructor: Rabie A. Ramadan, PhD
 Email: ra.ramadan@uoh.edu.sa
 Homepage: http://rabieramadan.org/classes/2015-
2016/COE200
 Office: Computer Engineering S259
 Office Hours
Mon 2- 4:00
Chapter 1 4
Textbook
 Logic and Computer Design
Fundamentals, M. Morris Mano and
Charles R. Kime (4th edition, 2008).
Prentice Hall.
 http://www.writphotec.com/mano4/
Chapter 1 5
Grading Information
 Grading
 Laboratory 15%
 Class work & Quizzes 10%
 Exam 1 15%
 Exam 2 15%
 Final 45%
 Policies
• Attendance is required
• All submitted work must be yours
• Cheating will not be tolerated
• Homeworks are due cy deadline – no extensions will be
provided - Blackboard
Chapter 1 6
Course Content
• Digital Systems and Information
• Combinational Logic Circuits
• Combinational Logic Design
 First Exam
• Arithmetic Functions and HDLs
• Sequential Circuits
• Selected Design Topics
 Second Exam
• Registers and Register Transfers
• Memory Basics
Final Exam
Class Style
 Do not think of the exam
• Just think of the class materials and how much you
learn from it
 Feel free to stop me at any time
• I do not care how much I teach in class as long as you
understand what I am saying
 There will be an interactive sessions in
class
 you solve some of the problems with my help
Chapter 1 7
When the time is up , just let me know….
Chapter 1 8
Chapter 1 9
Charles Kime & Thomas Kaminski
© 2008 Pearson Education, Inc.
(Hyperlinks are active in View Show mode)
Chapter 1 – Digital Systems
and Information
Logic and Computer Design Fundamentals
Chapter 1 11
Overview
 Introduction to Digital Systems
 Information Representation
 Number Systems [binary, octal and hexadecimal]
 Arithmetic Operations
 Base Conversion
 Decimal Codes [Binary Coded Decimal (BCD)]
 Gray Codes
 Alphanumeric Codes
 Parity Bit
Chapter 1 12
DIGITAL & COMPUTER SYSTEMS
 Takes a set of discrete information inputs and discrete
internal information (system state) and generates a set of
discrete information outputs.
System State
Discrete
Information
Processing
System
Discrete
Inputs Discrete
Outputs
Chapter 1 13
Types of Digital Systems
 No state present
• Combinational Logic System
• Output = Function(Input)
 State present
• State updated at discrete times
=> Synchronous Sequential System
• State updated at any time
=>Asynchronous Sequential System
• State = Function (State, Input)
• Output = Function (State, Input)
Chapter 1 14
Digital System Example:
A Digital Counter (e. g., odometer):
1 3
0 0 5 6 4
Count Up
Reset
Inputs: Count Up, Reset
Outputs: Visual Display
State: "Value" of stored digits
Chapter 1 15
INFORMATION REPRESENTATION - Signals
 Information variables represented by physical quantities.
 For digital systems, the variables take 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
Chapter 1 16
Signal Examples Over Time
Analog
Asynchronous
Synchronous
Time
Continuous
in value &
time
Discrete in
value &
continuous
in time
Discrete in
value & time
Digital
Chapter 1 17
Signal Example – Physical Quantity: Voltage
Threshold
Region
Chapter 1 18
NUMBER SYSTEMS – Representation
 Positive radix, positional number systems
 A number with 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.
 The string of digits represents the power series:
( ) ( )
(Number)r= 
 +
j = - m
j
j
i
i = 0
i r
A
r
A
(Integer Portion) + (Fraction Portion)
i = n - 1 j = - 1
Chapter 1 19
Number Systems – Examples
General Decimal Binary
Radix (Base) r 10 2
Digits 0 => r - 1 0 => 9 0 => 1
0
1
2
3
Powers of 4
Radix 5
-1
-2
-3
-4
-5
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
Chapter 1 20
Special Powers of 2
 210 (1024) is Kilo, denoted "K"
 220 (1,048,576) is Mega, denoted "M"
 230 (1,073, 741,824) is Giga, denoted "G"
 240 (1,099,511,627,776) is Tera, denoted “T"
Chapter 1 21
ARITHMETIC OPERATIONS - Binary
Arithmetic
 Single Bit Addition with Carry
 Multiple Bit Addition
 Single Bit Subtraction with Borrow
 Multiple Bit Subtraction
 Multiplication
 BCD Addition
2-22 5
Aha!
642 is 600 + 40 + 2 in BASE 10
The base of a number determines the number of digits and the
value of digit positions
Natural Numbers
2-23 6
Continuing with our example…
642 in base 10 positional notation is:
6 x 10² = 6 x 100 = 600
+ 4 x 10¹ = 4 x 10 = 40
+ 2 x 10º = 2 x 1 = 2 = 642 in base 10
This number is in
base 10
The power indicates
the position of
the number
Positional Notation
2-24 7
Positional Notation
2-25 6
8
What if 642 has the base of 13?
642 in base 13 is equivalent to 1068 in base 10
+ 6 x 13² = 6 x 169 = 1014
+ 4 x 13¹ = 4 x 13 = 52
+ 2 x 13º = 2 x 1 = 2
= 1068 in base 10
Positional Notation
2-26 9
Decimal is base 10 and has 10 digits:
0,1,2,3,4,5,6,7,8,9
Binary is base 2 and has 2 digits:
0,1
For a number to exist in a given number system, the
number system must include those digits. For example:
The number 284 only exists in base 9 and higher.
Binary
2-27 10
How are digits in bases higher than 10
represented?
Base 16:
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E, and F
Bases Higher than 10
2-28
What is the decimal equivalent of the octal number
642?
6 x 8² = 6 x 64 = 384
+ 4 x 8¹ = 4 x 8 = 32
+ 2 x 8º = 2 x 1 = 2
= 418 in base 10
11
Converting Octal to Decimal
2-29
What is the decimal equivalent of the hexadecimal number
DEF?
D x 16² = 13 x 256 = 3328
+ E x 16¹ = 14 x 16 = 224
+ F x 16º = 15 x 1 = 15
= 3567 in base 10
Remember, base 16 is 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
Converting Hexadecimal to Decimal
2-30
What is the decimal equivalent of the binary number 010110?
1 x 2
6
= 1 x 64 = 64
+ 1 x 2
5
= 1 x 32 = 32
+ 0 x 2
4
= 0 x 16 = 0
+ 1 x 2
3
= 1 x 8 = 8
+ 1 x 2
2
= 1 x 4 = 4
+ 1 x 2
1
= 1 x 2 = 2
+ 0 x 2º = 0 x 1 = 0
= 112 in base 10
13
Converting Binary to Decimal
Binary Addition
Chapter 1 31
Addition
 From right to left, we add each pair of digits
 We write the sum, and add the carry to the
next column on the left
1 9 8
+ 2 6 4
Sum
Carry
0 1 1
+ 0 0 1
Sum
Carry
2
1
6
1
4
0
0
1
0
1
1
0
Chapter 1 32
Binary Sums and Carries
a b Sum a b Carry
0 0 0 0 0 0
0 1 1 0 1 0
1 0 1 1 0 0
1 1 0 1 1 1
XOR AND
Chapter 1 33
Binary Addition (cont.)
Chapter 1 34
Binary Subtraction
Chapter 1 35
Binary Subtraction (cont.)
Chapter 1 36
One’s Complement
 The additive inverse of a one’s complement
representation is found by inverting each
bit.
 Inverting each bit is also called taking the
one’s complement
Chapter 1 37
Example
0000 0011 (3)
1111 1100 (-3)
1110 1000 (-23)
0001 0111 (23)
0000 0000 (0)
1111 1111 (0)
Note: There are two
representations of zero
Chapter 1 38
Two’s complement
 The additive inverse of a two’s complement
integer can be obtained by adding 1 to its
one’s complement
Chapter 1 39
Example
010001 (17) 1101000 (-24)
101110 0010111
1 1
------ -------
101111 (-17) 0011000 (24)
take the 1’s complement
Chapter 1 40
Subtracting the large number from the
small number
Chapter 1 41
Subtracting the large number from the
small number
Chapter 1 42
Subtracting the large number from the
small number
Chapter 1 43
Group Activity
Chapter 1 44
Group Activity
Chapter 1 45
Multiplication (decimal)
143
130
13
11
13
+

Chapter 1 46
Chapter 1 47
Binary Multiplication
The binary multiplication table is simple:
0  0 = 0 | 1  0 = 0 | 0  1 = 0 | 1  1 = 1
Extending multiplication to multiple digits:
Multiplicand 1011
Multiplier x 101
Partial Products 1011
0000 -
1011 - -
Product 110111
Multiplication (binary)
10001111
1101000
11010
1101
1011
1101
+

Chapter 1 48
Multiplication (binary)
10001111
1101000
11010
1101
1011
1101
+

It’s interesting to note that binary
multiplication is a sequence of shifts
and adds of the first term (depending
on the bits in the second term.
110100 is missing here because the
corresponding bit in the second
terms is 0.
Chapter 1 49
Chapter 1 50
 Useful for Base Conversion
Exponent Value Exponent Value
0 1 11 2,048
1 2 12 4,096
2 4 13 8,192
3 8 14 16,384
4 16 15 32,768
5 32 16 65,536
6 64 17 131,072
7 128 18 262,144
19 524,288
20 1,048,576
21 2,097,152
8 256
9 512
10 1024
BASE CONVERSION - Positive Powers of 2
Chapter 1 51
 To convert to decimal, use decimal
arithmetic to form S (digit × respective
power of 2).
 Example: Convert 110102 to N10:
Converting Binary to Decimal
Decimal to Binary Conversion
 Converting to binary – can’t use polynomial
evaluation!
 Whole part and fractional parts must be
handled separately!
• Whole part: Use repeated division.
• Fractional part: Use repeated multiplication.
• Combine results when finished.
Chapter 1 52
Decimal to Binary Conversion
(Whole Part: Repeated Division)
 Divide by target radix (2 in this case)
 Remainders become digits in the new
representation (0 <= digit < R)
 Digits produced in right to left order.
 Quotient is used as next dividend.
 Stop when the quotient becomes zero, but
use the corresponding remainder.
Chapter 1 53
Decimal to Binary Conversion
(Whole Part: Repeated Division)
97  2  quotient = 48, remainder = 1 (LSB)
48  2  quotient = 24, remainder = 0.
24  2  quotient = 12, remainder = 0.
12  2  quotient = 6, remainder = 0.
6  2  quotient = 3, remainder = 0.
3  2  quotient = 1, remainder = 1.
1  2  quotient = 0 (Stop) remainder = 1 (MSB)
Result = 1 1 0 0 0 0 12
Chapter 1 54
Decimal to Binary Conversion
(Fractional Part: Repeated Multiplication)
• Multiply by target radix (2 in this case)
• Whole part of product becomes digit in the
new representation (0 <= digit < R)
• Digits produced in left to right order.
• Fractional part of product is used as next
multiplicand.
• Stop when the fractional part becomes zero
(sometimes it won’t).
Chapter 1 55
Decimal to Binary Conversion
(Fractional Part: Repeated Multiplication)
.1  2  0.2 (fractional part = .2, whole part = 0)
.2  2  0.4 (fractional part = .4, whole part = 0)
.4  2  0.8 (fractional part = .8, whole part = 0)
.8  2  1.6 (fractional part = .6, whole part = 1)
.6  2  1.2 (fractional part = .2, whole part = 1)
Result = .000110001100011000112…..
(How much should we keep?)
Regardless of the number of digits , multiply them
by 2
Chapter 1 56
Counting in Binary
Dec Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
Note the pattern!
•LSB (bit 0) toggles on every count.
•Bit 1 toggles on every second
count.
•Bit 2 toggles on every fourth count.
•Etc….
Chapter 1 57
Representation Rollover
 Consequence of fixed precision.
 Computers use fixed precision!
 Digits are lost on the left-hand end.
 Remaining digits are still correct.
 Rollover while counting . . .
Up: “999999”  “000000” (Rn-1  0)
Down: “000000”  “999999” (0  Rn-1 )
Chapter 1 58
2.59
• We need to know how to convert a number in one
system to the equivalent number in another system.
• Since the decimal system is more familiar than the
other systems, we first show how to covert from any
base to decimal.
• Then we show how to convert from decimal to any
base.
• Finally, we show how we can easily convert from
binary to hexadecimal or octal and vice versa.
Conversion Summary
2.60
Any base to decimal conversion
Figure 2.5 Converting other bases to decimal
2.61
Example
The following shows how to convert the binary
number (110.11)2 to decimal: (110.11)2 = 6.75.
The following shows how to convert the hexadecimal
number (1A.23)16 to decimal.
Note that the result in the decimal notation is not exact,
because
3 × 16
−2
= 0.01171875. We have rounded this value to
three digits (0.012).
Example
Chapter 1 62
The following shows how to convert (23.17)
8
to
decimal.
This means that (23.17)8 ≈ 19.234 in decimal. Again,
we have rounded up 7 × 8
−2
= 0.109375.
Example
Chapter 1 63
Decimal to any base
Chapter 1 64
The following shows how to convert 35 in decimal to
binary. We start with the number in decimal, we
move to the left while continuously finding the
quotients and the remainder of division by 2. The
result is 35 = (100011)2.
Example
Chapter 1 65
2.66
The following shows how to convert 126 in decimal to its
equivalent in the octal system. We move to the right while
continuously finding the quotients and the remainder of division
by 8. The result is 126 = (176)8.
Example
2.67
The following shows how we convert 126 in decimal to its
equivalent in the hexadecimal system. We move to the
right while continuously finding the quotients and the
remainder of division by 16. The result is 126 = (7E)16
Example
2.68
Converting the fractional part of a number in decimal to
other bases
2.69
Convert the decimal number 0.625 to binary.
Since the number 0.625 = (0.101)2 has no integral part, the
example shows how the fractional part is calculated.
Example
The following shows how to convert 0.634 to octal
using a maximum of four digits. The result is 0.634 =
(0.5044)8. Note that we multiple by 8 (base octal).
Example
Chapter 1 70
2.71
The following shows how to convert 178.6 in decimal to
hexadecimal using only one digit to the right of the decimal point.
The result is 178.6 = (B2.9)16 Note that we divide or multiple by
16 (base hexadecimal).
Example
2.72
An alternative method for converting a small decimal
integer (usually less than 256) to binary is to break the
number as the sum of numbers that are equivalent to the
binary place values shown:
Example
2.73
A similar method can be used to convert a decimal fraction
to binary when the denominator is a power of two:
The answer is then (0.011011)2
Example
2.74
Show the hexadecimal equivalent of the binary number
(110011100010)2.
Solution
We first arrange the binary number in 4-bit patterns:
1100 1110 0010
Note that the leftmost pattern can have one to four bits.
Example
2.75
What is the binary equivalent of (24C)16?
Solution
Each hexadecimal digit is converted to 4-bit patterns:
2 → 0010, 4 → 0100, and C → 1100
The result is (001001001100)2.
Example
2.76
Show the octal equivalent of the binary number
(101110010)2.
Solution
Each group of three bits is translated into one
octal digit.
The result is (562)8.
101 110 010
Example
2.77
What is the binary equivalent of for (24)8?
Solution
Write each octal digit as its equivalent bit pattern to
get
2 → 010 and 4 → 100
The result is (010100)2.
Example
2.78
Octal-hexadecimal conversion
Octal to hexadecimal and hexadecimal to octal conversion
Chapter 1 79
Binary Numbers and Binary Coding
 Flexibility of representation
• Within constraints below, 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
Chapter 1 80
 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
binary code
for the seven
colors of the
rainbow
 Code 100 is
not used
Non-numeric Binary Codes
Binary Number
000
001
010
011
101
110
111
Color
Red
Orange
Yellow
Green
Blue
Indigo
Violet
Chapter 1 81
Number of Elements Represented
 Given n digits in radix r, there are rn
distinct elements that can be represented.
 But, you can represent m elements, m <
rn
 Examples:
• You can represent 4 elements in radix r = 2
with n = 2 digits: (00, 01, 10, 11).
• You can represent 4 elements in radix r = 2
with n = 4 digits: (0001, 0010, 0011, 1000).
• This second code is called a "one hot" code.
Chapter 1 82
DECIMAL CODES - Binary Codes for Decimal
Digits
Decimal 8,4,2,1 Excess3 8,4,-2,-1 Gray
0 0000 0011 0000 0000
1 0001 0100 0111 0100
2 0010 0101 0110 0101
3 0011 0110 0101 0111
4 0100 0111 0100 0110
5 0101 1000 1011 0010
6 0110 1001 1010 0011
7 0111 1010 1001 0001
8 1000 1011 1000 1001
9 1001 1100 1111 1000
 There are over 8,000 ways that you can chose 10 elements
from the 16 binary numbers of 4 bits. A few are useful:
Chapter 1 83
 What special property does the Gray code have
in relation to adjacent decimal digits?
GRAY CODE – Decimal
Decimal 8,4,2,1 Gray
0 0000 0000
1 0001 0100
2 0010 0101
3 0011 0111
4 0100 0110
5 0101 0010
6 0110 0011
7 0111 0001
8 1000 1001
9 1001 1000
Chapter 1 83
Chapter 1 84
UNICODE
 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
Chapter 1 84
Chapter 1 85
PARITY BIT Error-Detection Codes
 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 1’s 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
1’s in the code word is even.
 A code word has odd parity if the number of
1’s in the code word is odd.
Chapter 1 86
4-Bit Parity Code Example
 Fill in the even and odd parity bits:
 The codeword "1111" has even parity and the
codeword "1110" has odd parity. Both can be
used to represent 3-bit data.
Even Parity Odd Parity
Message- Parity Message- Parity
000 - 000 -
001 - 001 -
010 - 010 -
011 - 011 -
100 - 100 -
101 - 101 -
110 - 110 -
111 - 111 -
Binary-Coded Decimal (BCD)
• a BCD number is just a natural binary encoding of the
decimal digits from 0 to 9 on four bits.
0101 0111
59 in BCD (0 ~ 99)
because there are unused code words
87 in normal unsigned binary number (0 ~ 255)
Chapter 1 87
Binary-Coded Decimal (BCD)
• Binary-Coded Decimal is a weighted code because each
decimal digit can be obtained from its code word by
assigning a fixed weight to each code-word bit.
• The weights for the BCD bits are 8, 4, 2, and 1, and for this
reason the code is sometimes called the 8421 code.
Chapter 1 88
Excess-3 code
• This code is also self-complementing like 2421
code.
• Although this code is not weighted, it has an
arithmetic relationship with the BCD code.
• The code word for each decimal digit is the
corresponding BCD code word plus 0011
2
.
0010 = 2 in BCD
+ 00112
= 0101 = 2 in excess-3
Chapter 1 89
Gray Code
• Gray code is a code where only one bit changes at
a time while traversing from 0 to any decimal
number in sequence.
• This is a useful property when converting analog
values into digital values, since it eliminates the
problem of misinterpreting asynchronous changes
to bits between valid values.
Chapter 1 90
Gray Code
Chapter 1 91
Parity check
• One of the most common ways to achieve error detection is by means of a parity bit.
• A parity bit is an extra bit included with a message to make the total number of 1’s
transmitted either odd or even.
• If an odd parity is adopted, the P bit is chosen such that the total number of 1’s is odd.
Chapter 1 92

More Related Content

PPTX
Logic Circuits Design - "Chapter 1: Digital Systems and Information"
Ra'Fat Al-Msie'deen
 
PPT
1. basic theories of information
'Cedrick SuperGreenilistic Expialidocious Antonino
 
PPTX
Parallel adders
sana younas
 
PPTX
Digital Electronics and Computer Language
Manthan Chavda
 
PDF
chapter one && two.pdf
miftah88
 
PPT
Number system and codes
Abhiraj Bohra
 
PPT
Digital logic design part1
Vaagdevi College of Engineering
 
PPTX
number system
Unsa Shakir
 
Logic Circuits Design - "Chapter 1: Digital Systems and Information"
Ra'Fat Al-Msie'deen
 
1. basic theories of information
'Cedrick SuperGreenilistic Expialidocious Antonino
 
Parallel adders
sana younas
 
Digital Electronics and Computer Language
Manthan Chavda
 
chapter one && two.pdf
miftah88
 
Number system and codes
Abhiraj Bohra
 
Digital logic design part1
Vaagdevi College of Engineering
 
number system
Unsa Shakir
 

What's hot (20)

PDF
Chapter 1 digital systems and binary numbers
Mohammad Bashartullah
 
PPT
digital logic design number system
Nallapati Anindra
 
PPT
Number systems ppt
sudarmani rajagopal
 
PPTX
Okkkkk
Bilal Maqbool ツ
 
PPTX
Number system and their conversion
Ram Pratap Singh
 
PPT
Logic Design 2009
lionking
 
PPT
Bolum1cozumler
bhuvanaaswini
 
PPTX
06 floating point
Piyush Rochwani
 
PPT
Data representation moris mano ch 03
thearticlenow
 
PDF
Logic Design
Partha_bappa
 
PPT
Lec 02 data representation part 1
Abdul Khan
 
PPTX
dld 01-introduction
United International University
 
PPTX
data representation
Haroon_007
 
PPT
ACIT Mumbai - CCNA Training Coourse- IP ADDRESS ASSIGNMENT
Sleek International
 
PPT
Lec 02 data representation part 2
Abdul Khan
 
PDF
Digital notes
stivengo2
 
PPT
L2 number
mondalakash2012
 
PDF
Module 1 number systems and code1
Deepak John
 
PPTX
Computer Number System
RajGopalAgrawal
 
PPT
Mba admission in india
Edhole.com
 
Chapter 1 digital systems and binary numbers
Mohammad Bashartullah
 
digital logic design number system
Nallapati Anindra
 
Number systems ppt
sudarmani rajagopal
 
Number system and their conversion
Ram Pratap Singh
 
Logic Design 2009
lionking
 
Bolum1cozumler
bhuvanaaswini
 
06 floating point
Piyush Rochwani
 
Data representation moris mano ch 03
thearticlenow
 
Logic Design
Partha_bappa
 
Lec 02 data representation part 1
Abdul Khan
 
dld 01-introduction
United International University
 
data representation
Haroon_007
 
ACIT Mumbai - CCNA Training Coourse- IP ADDRESS ASSIGNMENT
Sleek International
 
Lec 02 data representation part 2
Abdul Khan
 
Digital notes
stivengo2
 
L2 number
mondalakash2012
 
Module 1 number systems and code1
Deepak John
 
Computer Number System
RajGopalAgrawal
 
Mba admission in india
Edhole.com
 
Ad

Similar to Module 4 (20)

PPT
digital systems and information
Kamran Zafar
 
PPT
100_2_digitalSystem_Chap1 (2).ppt
namraashraf56
 
PPTX
Chapter 1 digital design.pptx
AliaaTarek5
 
PPT
IntroductiontoDigitalElectronics IntroductiontoDigitalElectronics
sudheerkumar655
 
PPT
IntroductiontoDigitalElectronics IntroductiontoDigitalElectronics
sudheerkumar655
 
PPT
LCDF3_Chap_01 computer engineering 01.ppt
AbhishekGiri933736
 
PPTX
DLD-Introduction.pptx
UzairAhmadWalana
 
PPTX
LCDF3_Chap_01x.pptx
DaniyalMunir1
 
PPT
ENG241-Week1-NumberSystemsaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bao201875
 
PPTX
Chapter 3.pptx
Wollo UNiversity
 
PPTX
binary system with boolean simpification
MARaihanEmon
 
PDF
Module 1 Digital Logic Design .pptx.pdf
tweetya25
 
PPT
Chapter 1 Digital Systems and Binary Numbers.ppt
AparnaDas827261
 
PPT
Number_Systems (2).ppt
nivedita murugan
 
PPT
Number_Systems _binary_octal_hex_dec.ppt
ManoRanjani30
 
PPT
An introduction to the different number systems
hassanbokhari14
 
PPT
Number Systems and its effectiveness .ppt
MuhammadAdeel321
 
PPT
Number_Systems_Number base conversions.ppt
anushachalla14
 
PPT
Number_Systems decimal, binary, octal, and hexadecimal
Meenakshi Munjal
 
digital systems and information
Kamran Zafar
 
100_2_digitalSystem_Chap1 (2).ppt
namraashraf56
 
Chapter 1 digital design.pptx
AliaaTarek5
 
IntroductiontoDigitalElectronics IntroductiontoDigitalElectronics
sudheerkumar655
 
IntroductiontoDigitalElectronics IntroductiontoDigitalElectronics
sudheerkumar655
 
LCDF3_Chap_01 computer engineering 01.ppt
AbhishekGiri933736
 
DLD-Introduction.pptx
UzairAhmadWalana
 
LCDF3_Chap_01x.pptx
DaniyalMunir1
 
ENG241-Week1-NumberSystemsaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bao201875
 
Chapter 3.pptx
Wollo UNiversity
 
binary system with boolean simpification
MARaihanEmon
 
Module 1 Digital Logic Design .pptx.pdf
tweetya25
 
Chapter 1 Digital Systems and Binary Numbers.ppt
AparnaDas827261
 
Number_Systems (2).ppt
nivedita murugan
 
Number_Systems _binary_octal_hex_dec.ppt
ManoRanjani30
 
An introduction to the different number systems
hassanbokhari14
 
Number Systems and its effectiveness .ppt
MuhammadAdeel321
 
Number_Systems_Number base conversions.ppt
anushachalla14
 
Number_Systems decimal, binary, octal, and hexadecimal
Meenakshi Munjal
 
Ad

Recently uploaded (20)

DOCX
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
DOCX
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
PPTX
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
PPTX
Virus sequence retrieval from NCBI database
yamunaK13
 
PPTX
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
PPTX
Gupta Art & Architecture Temple and Sculptures.pptx
Virag Sontakke
 
PDF
Virat Kohli- the Pride of Indian cricket
kushpar147
 
PPTX
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
PPTX
How to Apply for a Job From Odoo 18 Website
Celine George
 
PPTX
CDH. pptx
AneetaSharma15
 
PDF
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
PPTX
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
PDF
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
PPTX
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
PPTX
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
PPTX
A Smarter Way to Think About Choosing a College
Cyndy McDonald
 
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
Cleaning Validation Ppt Pharmaceutical validation
Ms. Ashatai Patil
 
Virus sequence retrieval from NCBI database
yamunaK13
 
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
Gupta Art & Architecture Temple and Sculptures.pptx
Virag Sontakke
 
Virat Kohli- the Pride of Indian cricket
kushpar147
 
family health care settings home visit - unit 6 - chn 1 - gnm 1st year.pptx
Priyanshu Anand
 
How to Apply for a Job From Odoo 18 Website
Celine George
 
CDH. pptx
AneetaSharma15
 
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
A Smarter Way to Think About Choosing a College
Cyndy McDonald
 

Module 4

  • 1. Chapter 1 1 COE 200 Introduction
  • 2. Chapter 1 2 Outline  Course Introduction •Course Information •Textbook •Grading •Important Dates •Course Outline
  • 3. Chapter 1 3 Course Information  Instructor: Rabie A. Ramadan, PhD  Email: [email protected]  Homepage: http://rabieramadan.org/classes/2015- 2016/COE200  Office: Computer Engineering S259  Office Hours Mon 2- 4:00
  • 4. Chapter 1 4 Textbook  Logic and Computer Design Fundamentals, M. Morris Mano and Charles R. Kime (4th edition, 2008). Prentice Hall.  http://www.writphotec.com/mano4/
  • 5. Chapter 1 5 Grading Information  Grading  Laboratory 15%  Class work & Quizzes 10%  Exam 1 15%  Exam 2 15%  Final 45%  Policies • Attendance is required • All submitted work must be yours • Cheating will not be tolerated • Homeworks are due cy deadline – no extensions will be provided - Blackboard
  • 6. Chapter 1 6 Course Content • Digital Systems and Information • Combinational Logic Circuits • Combinational Logic Design  First Exam • Arithmetic Functions and HDLs • Sequential Circuits • Selected Design Topics  Second Exam • Registers and Register Transfers • Memory Basics Final Exam
  • 7. Class Style  Do not think of the exam • Just think of the class materials and how much you learn from it  Feel free to stop me at any time • I do not care how much I teach in class as long as you understand what I am saying  There will be an interactive sessions in class  you solve some of the problems with my help Chapter 1 7
  • 8. When the time is up , just let me know…. Chapter 1 8
  • 10. Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 1 – Digital Systems and Information Logic and Computer Design Fundamentals
  • 11. Chapter 1 11 Overview  Introduction to Digital Systems  Information Representation  Number Systems [binary, octal and hexadecimal]  Arithmetic Operations  Base Conversion  Decimal Codes [Binary Coded Decimal (BCD)]  Gray Codes  Alphanumeric Codes  Parity Bit
  • 12. Chapter 1 12 DIGITAL & COMPUTER SYSTEMS  Takes a set of discrete information inputs and discrete internal information (system state) and generates a set of discrete information outputs. System State Discrete Information Processing System Discrete Inputs Discrete Outputs
  • 13. Chapter 1 13 Types of Digital Systems  No state present • Combinational Logic System • Output = Function(Input)  State present • State updated at discrete times => Synchronous Sequential System • State updated at any time =>Asynchronous Sequential System • State = Function (State, Input) • Output = Function (State, Input)
  • 14. Chapter 1 14 Digital System Example: A Digital Counter (e. g., odometer): 1 3 0 0 5 6 4 Count Up Reset Inputs: Count Up, Reset Outputs: Visual Display State: "Value" of stored digits
  • 15. Chapter 1 15 INFORMATION REPRESENTATION - Signals  Information variables represented by physical quantities.  For digital systems, the variables take 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
  • 16. Chapter 1 16 Signal Examples Over Time Analog Asynchronous Synchronous Time Continuous in value & time Discrete in value & continuous in time Discrete in value & time Digital
  • 17. Chapter 1 17 Signal Example – Physical Quantity: Voltage Threshold Region
  • 18. Chapter 1 18 NUMBER SYSTEMS – Representation  Positive radix, positional number systems  A number with 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.  The string of digits represents the power series: ( ) ( ) (Number)r=   + j = - m j j i i = 0 i r A r A (Integer Portion) + (Fraction Portion) i = n - 1 j = - 1
  • 19. Chapter 1 19 Number Systems – Examples General Decimal Binary Radix (Base) r 10 2 Digits 0 => r - 1 0 => 9 0 => 1 0 1 2 3 Powers of 4 Radix 5 -1 -2 -3 -4 -5 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
  • 20. Chapter 1 20 Special Powers of 2  210 (1024) is Kilo, denoted "K"  220 (1,048,576) is Mega, denoted "M"  230 (1,073, 741,824) is Giga, denoted "G"  240 (1,099,511,627,776) is Tera, denoted “T"
  • 21. Chapter 1 21 ARITHMETIC OPERATIONS - Binary Arithmetic  Single Bit Addition with Carry  Multiple Bit Addition  Single Bit Subtraction with Borrow  Multiple Bit Subtraction  Multiplication  BCD Addition
  • 22. 2-22 5 Aha! 642 is 600 + 40 + 2 in BASE 10 The base of a number determines the number of digits and the value of digit positions Natural Numbers
  • 23. 2-23 6 Continuing with our example… 642 in base 10 positional notation is: 6 x 10² = 6 x 100 = 600 + 4 x 10¹ = 4 x 10 = 40 + 2 x 10º = 2 x 1 = 2 = 642 in base 10 This number is in base 10 The power indicates the position of the number Positional Notation
  • 25. 2-25 6 8 What if 642 has the base of 13? 642 in base 13 is equivalent to 1068 in base 10 + 6 x 13² = 6 x 169 = 1014 + 4 x 13¹ = 4 x 13 = 52 + 2 x 13º = 2 x 1 = 2 = 1068 in base 10 Positional Notation
  • 26. 2-26 9 Decimal is base 10 and has 10 digits: 0,1,2,3,4,5,6,7,8,9 Binary is base 2 and has 2 digits: 0,1 For a number to exist in a given number system, the number system must include those digits. For example: The number 284 only exists in base 9 and higher. Binary
  • 27. 2-27 10 How are digits in bases higher than 10 represented? Base 16: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E, and F Bases Higher than 10
  • 28. 2-28 What is the decimal equivalent of the octal number 642? 6 x 8² = 6 x 64 = 384 + 4 x 8¹ = 4 x 8 = 32 + 2 x 8º = 2 x 1 = 2 = 418 in base 10 11 Converting Octal to Decimal
  • 29. 2-29 What is the decimal equivalent of the hexadecimal number DEF? D x 16² = 13 x 256 = 3328 + E x 16¹ = 14 x 16 = 224 + F x 16º = 15 x 1 = 15 = 3567 in base 10 Remember, base 16 is 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F Converting Hexadecimal to Decimal
  • 30. 2-30 What is the decimal equivalent of the binary number 010110? 1 x 2 6 = 1 x 64 = 64 + 1 x 2 5 = 1 x 32 = 32 + 0 x 2 4 = 0 x 16 = 0 + 1 x 2 3 = 1 x 8 = 8 + 1 x 2 2 = 1 x 4 = 4 + 1 x 2 1 = 1 x 2 = 2 + 0 x 2º = 0 x 1 = 0 = 112 in base 10 13 Converting Binary to Decimal
  • 32. Addition  From right to left, we add each pair of digits  We write the sum, and add the carry to the next column on the left 1 9 8 + 2 6 4 Sum Carry 0 1 1 + 0 0 1 Sum Carry 2 1 6 1 4 0 0 1 0 1 1 0 Chapter 1 32
  • 33. Binary Sums and Carries a b Sum a b Carry 0 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 0 1 1 0 1 1 1 XOR AND Chapter 1 33
  • 37. One’s Complement  The additive inverse of a one’s complement representation is found by inverting each bit.  Inverting each bit is also called taking the one’s complement Chapter 1 37
  • 38. Example 0000 0011 (3) 1111 1100 (-3) 1110 1000 (-23) 0001 0111 (23) 0000 0000 (0) 1111 1111 (0) Note: There are two representations of zero Chapter 1 38
  • 39. Two’s complement  The additive inverse of a two’s complement integer can be obtained by adding 1 to its one’s complement Chapter 1 39
  • 40. Example 010001 (17) 1101000 (-24) 101110 0010111 1 1 ------ ------- 101111 (-17) 0011000 (24) take the 1’s complement Chapter 1 40
  • 41. Subtracting the large number from the small number Chapter 1 41
  • 42. Subtracting the large number from the small number Chapter 1 42
  • 43. Subtracting the large number from the small number Chapter 1 43
  • 47. Chapter 1 47 Binary Multiplication The binary multiplication table is simple: 0  0 = 0 | 1  0 = 0 | 0  1 = 0 | 1  1 = 1 Extending multiplication to multiple digits: Multiplicand 1011 Multiplier x 101 Partial Products 1011 0000 - 1011 - - Product 110111
  • 49. Multiplication (binary) 10001111 1101000 11010 1101 1011 1101 +  It’s interesting to note that binary multiplication is a sequence of shifts and adds of the first term (depending on the bits in the second term. 110100 is missing here because the corresponding bit in the second terms is 0. Chapter 1 49
  • 50. Chapter 1 50  Useful for Base Conversion Exponent Value Exponent Value 0 1 11 2,048 1 2 12 4,096 2 4 13 8,192 3 8 14 16,384 4 16 15 32,768 5 32 16 65,536 6 64 17 131,072 7 128 18 262,144 19 524,288 20 1,048,576 21 2,097,152 8 256 9 512 10 1024 BASE CONVERSION - Positive Powers of 2
  • 51. Chapter 1 51  To convert to decimal, use decimal arithmetic to form S (digit × respective power of 2).  Example: Convert 110102 to N10: Converting Binary to Decimal
  • 52. Decimal to Binary Conversion  Converting to binary – can’t use polynomial evaluation!  Whole part and fractional parts must be handled separately! • Whole part: Use repeated division. • Fractional part: Use repeated multiplication. • Combine results when finished. Chapter 1 52
  • 53. Decimal to Binary Conversion (Whole Part: Repeated Division)  Divide by target radix (2 in this case)  Remainders become digits in the new representation (0 <= digit < R)  Digits produced in right to left order.  Quotient is used as next dividend.  Stop when the quotient becomes zero, but use the corresponding remainder. Chapter 1 53
  • 54. Decimal to Binary Conversion (Whole Part: Repeated Division) 97  2  quotient = 48, remainder = 1 (LSB) 48  2  quotient = 24, remainder = 0. 24  2  quotient = 12, remainder = 0. 12  2  quotient = 6, remainder = 0. 6  2  quotient = 3, remainder = 0. 3  2  quotient = 1, remainder = 1. 1  2  quotient = 0 (Stop) remainder = 1 (MSB) Result = 1 1 0 0 0 0 12 Chapter 1 54
  • 55. Decimal to Binary Conversion (Fractional Part: Repeated Multiplication) • Multiply by target radix (2 in this case) • Whole part of product becomes digit in the new representation (0 <= digit < R) • Digits produced in left to right order. • Fractional part of product is used as next multiplicand. • Stop when the fractional part becomes zero (sometimes it won’t). Chapter 1 55
  • 56. Decimal to Binary Conversion (Fractional Part: Repeated Multiplication) .1  2  0.2 (fractional part = .2, whole part = 0) .2  2  0.4 (fractional part = .4, whole part = 0) .4  2  0.8 (fractional part = .8, whole part = 0) .8  2  1.6 (fractional part = .6, whole part = 1) .6  2  1.2 (fractional part = .2, whole part = 1) Result = .000110001100011000112….. (How much should we keep?) Regardless of the number of digits , multiply them by 2 Chapter 1 56
  • 57. Counting in Binary Dec Binary 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 Note the pattern! •LSB (bit 0) toggles on every count. •Bit 1 toggles on every second count. •Bit 2 toggles on every fourth count. •Etc…. Chapter 1 57
  • 58. Representation Rollover  Consequence of fixed precision.  Computers use fixed precision!  Digits are lost on the left-hand end.  Remaining digits are still correct.  Rollover while counting . . . Up: “999999”  “000000” (Rn-1  0) Down: “000000”  “999999” (0  Rn-1 ) Chapter 1 58
  • 59. 2.59 • We need to know how to convert a number in one system to the equivalent number in another system. • Since the decimal system is more familiar than the other systems, we first show how to covert from any base to decimal. • Then we show how to convert from decimal to any base. • Finally, we show how we can easily convert from binary to hexadecimal or octal and vice versa. Conversion Summary
  • 60. 2.60 Any base to decimal conversion Figure 2.5 Converting other bases to decimal
  • 61. 2.61 Example The following shows how to convert the binary number (110.11)2 to decimal: (110.11)2 = 6.75.
  • 62. The following shows how to convert the hexadecimal number (1A.23)16 to decimal. Note that the result in the decimal notation is not exact, because 3 × 16 −2 = 0.01171875. We have rounded this value to three digits (0.012). Example Chapter 1 62
  • 63. The following shows how to convert (23.17) 8 to decimal. This means that (23.17)8 ≈ 19.234 in decimal. Again, we have rounded up 7 × 8 −2 = 0.109375. Example Chapter 1 63
  • 64. Decimal to any base Chapter 1 64
  • 65. The following shows how to convert 35 in decimal to binary. We start with the number in decimal, we move to the left while continuously finding the quotients and the remainder of division by 2. The result is 35 = (100011)2. Example Chapter 1 65
  • 66. 2.66 The following shows how to convert 126 in decimal to its equivalent in the octal system. We move to the right while continuously finding the quotients and the remainder of division by 8. The result is 126 = (176)8. Example
  • 67. 2.67 The following shows how we convert 126 in decimal to its equivalent in the hexadecimal system. We move to the right while continuously finding the quotients and the remainder of division by 16. The result is 126 = (7E)16 Example
  • 68. 2.68 Converting the fractional part of a number in decimal to other bases
  • 69. 2.69 Convert the decimal number 0.625 to binary. Since the number 0.625 = (0.101)2 has no integral part, the example shows how the fractional part is calculated. Example
  • 70. The following shows how to convert 0.634 to octal using a maximum of four digits. The result is 0.634 = (0.5044)8. Note that we multiple by 8 (base octal). Example Chapter 1 70
  • 71. 2.71 The following shows how to convert 178.6 in decimal to hexadecimal using only one digit to the right of the decimal point. The result is 178.6 = (B2.9)16 Note that we divide or multiple by 16 (base hexadecimal). Example
  • 72. 2.72 An alternative method for converting a small decimal integer (usually less than 256) to binary is to break the number as the sum of numbers that are equivalent to the binary place values shown: Example
  • 73. 2.73 A similar method can be used to convert a decimal fraction to binary when the denominator is a power of two: The answer is then (0.011011)2 Example
  • 74. 2.74 Show the hexadecimal equivalent of the binary number (110011100010)2. Solution We first arrange the binary number in 4-bit patterns: 1100 1110 0010 Note that the leftmost pattern can have one to four bits. Example
  • 75. 2.75 What is the binary equivalent of (24C)16? Solution Each hexadecimal digit is converted to 4-bit patterns: 2 → 0010, 4 → 0100, and C → 1100 The result is (001001001100)2. Example
  • 76. 2.76 Show the octal equivalent of the binary number (101110010)2. Solution Each group of three bits is translated into one octal digit. The result is (562)8. 101 110 010 Example
  • 77. 2.77 What is the binary equivalent of for (24)8? Solution Write each octal digit as its equivalent bit pattern to get 2 → 010 and 4 → 100 The result is (010100)2. Example
  • 78. 2.78 Octal-hexadecimal conversion Octal to hexadecimal and hexadecimal to octal conversion
  • 79. Chapter 1 79 Binary Numbers and Binary Coding  Flexibility of representation • Within constraints below, 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
  • 80. Chapter 1 80  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 binary code for the seven colors of the rainbow  Code 100 is not used Non-numeric Binary Codes Binary Number 000 001 010 011 101 110 111 Color Red Orange Yellow Green Blue Indigo Violet
  • 81. Chapter 1 81 Number of Elements Represented  Given n digits in radix r, there are rn distinct elements that can be represented.  But, you can represent m elements, m < rn  Examples: • You can represent 4 elements in radix r = 2 with n = 2 digits: (00, 01, 10, 11). • You can represent 4 elements in radix r = 2 with n = 4 digits: (0001, 0010, 0011, 1000). • This second code is called a "one hot" code.
  • 82. Chapter 1 82 DECIMAL CODES - Binary Codes for Decimal Digits Decimal 8,4,2,1 Excess3 8,4,-2,-1 Gray 0 0000 0011 0000 0000 1 0001 0100 0111 0100 2 0010 0101 0110 0101 3 0011 0110 0101 0111 4 0100 0111 0100 0110 5 0101 1000 1011 0010 6 0110 1001 1010 0011 7 0111 1010 1001 0001 8 1000 1011 1000 1001 9 1001 1100 1111 1000  There are over 8,000 ways that you can chose 10 elements from the 16 binary numbers of 4 bits. A few are useful:
  • 83. Chapter 1 83  What special property does the Gray code have in relation to adjacent decimal digits? GRAY CODE – Decimal Decimal 8,4,2,1 Gray 0 0000 0000 1 0001 0100 2 0010 0101 3 0011 0111 4 0100 0110 5 0101 0010 6 0110 0011 7 0111 0001 8 1000 1001 9 1001 1000 Chapter 1 83
  • 84. Chapter 1 84 UNICODE  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 Chapter 1 84
  • 85. Chapter 1 85 PARITY BIT Error-Detection Codes  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 1’s 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 1’s in the code word is even.  A code word has odd parity if the number of 1’s in the code word is odd.
  • 86. Chapter 1 86 4-Bit Parity Code Example  Fill in the even and odd parity bits:  The codeword "1111" has even parity and the codeword "1110" has odd parity. Both can be used to represent 3-bit data. Even Parity Odd Parity Message- Parity Message- Parity 000 - 000 - 001 - 001 - 010 - 010 - 011 - 011 - 100 - 100 - 101 - 101 - 110 - 110 - 111 - 111 -
  • 87. Binary-Coded Decimal (BCD) • a BCD number is just a natural binary encoding of the decimal digits from 0 to 9 on four bits. 0101 0111 59 in BCD (0 ~ 99) because there are unused code words 87 in normal unsigned binary number (0 ~ 255) Chapter 1 87
  • 88. Binary-Coded Decimal (BCD) • Binary-Coded Decimal is a weighted code because each decimal digit can be obtained from its code word by assigning a fixed weight to each code-word bit. • The weights for the BCD bits are 8, 4, 2, and 1, and for this reason the code is sometimes called the 8421 code. Chapter 1 88
  • 89. Excess-3 code • This code is also self-complementing like 2421 code. • Although this code is not weighted, it has an arithmetic relationship with the BCD code. • The code word for each decimal digit is the corresponding BCD code word plus 0011 2 . 0010 = 2 in BCD + 00112 = 0101 = 2 in excess-3 Chapter 1 89
  • 90. Gray Code • Gray code is a code where only one bit changes at a time while traversing from 0 to any decimal number in sequence. • This is a useful property when converting analog values into digital values, since it eliminates the problem of misinterpreting asynchronous changes to bits between valid values. Chapter 1 90
  • 92. Parity check • One of the most common ways to achieve error detection is by means of a parity bit. • A parity bit is an extra bit included with a message to make the total number of 1’s transmitted either odd or even. • If an odd parity is adopted, the P bit is chosen such that the total number of 1’s is odd. Chapter 1 92