SlideShare ist ein Scribd-Unternehmen logo
1 von 52
Chapter 1
Digital Systems and Information
Logic Circuits Design
Mutah University
Faculty of IT, Department of Software Engineering
Dr. Ra’Fat A. AL-msie’deen
Course Info
 Course title: Logic Circuits Design.
 Credit hours (theory, practical): 3 hours.
 Instructor: Dr. Ra’Fat A. AL-msie’Deen.
Required Textbook
 Logic and Computer Design
Fundamentals.
– Fifth Edition.
– M. Morris Mano, Charles R.
Kime, Tom Martin.
– 2014.
Generic Computer
Information Representation
 Digital systems store, move, and process information.
 Information represents a broad range of phenomena from:
– The physical world:
• Characterized by parameters such as weight, temperature,
and frequency.
• Most physical parameters are continuous: capable of taking
on all possible values over a defined range.
– Man-made world:
• Such as business records using words, quantities, and
currencies.
• Parameters are discrete in nature.
 In general, information systems must be able to represent both
continuous and discrete information.
Information Representation (Cont.)
 The signals in most present-day electronic digital systems use
just two discrete values and are therefore said to be binary.
 The two discrete values used are often called 0 and 1, the
digits for the binary number system.
(Figure) Examples
of Voltage Ranges
and Waveforms for
Binary Signals.
Information is represented using signals.
 Electrical signals such as voltages and
currents are the most common.
 There are two types of signals:
– Analog signals represent
information that is continuous in
time and value.
– Digital signals represent
information that is discrete in time
and value.
What is a digital system?
 It is a system that manipulates (processes) discrete elements
of information.
 A digital system is a discrete information processing system.
 Examples of digital systems:
– the calculator,
– digital voltmeters,
– and general purpose computers.
 In such systems, all quantities are represented using two
values.
 Note: if the system in Not Digital, it is "Analog".
What is A/D conversion?
 To process analog data using a digital system, we need analog to
digital (A/D) conversion.
 There are two main steps in order to discretize a signal:
– Sampling: taking finite samples in time (discretize in time).
Samples are taken by measuring the value of the signal at
regular time intervals.
– Quantization: taking finite values (discretize in value).
 Sampling + quantization + encoding ≡ ADC ≡ A/D ≡ Analog
to digital conversion
What is A/D conversion? (Cont.)
What is A/D conversion? (Cont.)
 How many values to consider when quantizing data?
– Multi-valued quantization.
– Binary-valued quantization
 Example: Comparison between multi-valued and binary-
valued quantization assuming that the voltage range is 0-3.
Voltage Multi-valued Binary-valued
0-0.5 0 000
0.5-1 1 001 (encoding)
1-1.5 2 010
1.5-2 3 011
2-2.5 4 100
2.5-3 5 101
Sample value Digital Multi-valued logic Digital binary
What is A/D conversion? (Cont.)
 Note that in order to transfer data in case of multi-valued
quantization, we need fewer wires.
 In this example, the multi-valued quantized data requires
one wire whereas binary-valued quantized data requires
three wires.
 However, binary quantization is preferred over multi-
valued quantization since it provides higher immunity to
noise.
 In general, binary systems are preferred since they are
simpler, easy to design, and extremely reliable.
 Note: Always keep in mind that digital does not mean binary.
The Digital Computer
 General-Purpose Computers are an example of binary
systems.
 A block diagram of a digital computer is shown in Figure
below.
The Digital Computer
 The memory stores programs as well as input, output, ….
 The datapath (ALU) performs arithmetic and other data-
processing operations as specified by the program.
 The control unit supervises the flow of information between
the various units.
 A datapath, when combined with the control unit, forms a
component referred to as a central processing unit, or CPU.
 Input device: keyboard.
 Output device: LCD (liquid crystal display).
– These devices use digital logic circuits
Digital logic
 Digital logic: is a science that deals with circuits that operate
on a set of two-valued elements; binary values.
Digital logic (Cont.)
 Physical quantities: continuous.
 Signal: mathematical function that describes physical
quantities.
 Digital signal: discrete in time and finite.
 Analog signal: infinite values.
 Again: why digital?
– Analog has errors.
– Digital systems have excellent noise immunity.
 Most real life signals are analog signals (continuous)
Number Systems
 We will deal with different systems.
 The systems of numbering we consider are positional positive
radix (base) system.
 In general the structure of any number in base r:
 Where A is any value in [0, r-1].
– Base 5 → [0 - 4]
Least Significant Digit (LSD)Most Significant Digit (MSD)
The Binary Numbering System
 The binary number system is a base 2 system with two digits:
0 and 1.
 A binary digit is called a bit.
 bit - binary digit.
 The decimal equivalent of a binary number can be found by
expanding the number into a power series with a base of 2.
– For example,
– (11010)2 = 1 * 24 + 1 * 23 + 0 * 22 + 1 * 21 + 0 * 20
= (26)10
The Binary Numbering System (Cont.)
 The digits in a binary number are called bits.
 When a bit is equal to 0, it does not contribute to the sum during
the conversion.
 Therefore, the conversion to decimal can be obtained by adding the
numbers with powers of two corresponding to the bits that are
equal to 1.
– For example,
• (110101.11)2 = ( ? )10
– Solution:
• (110101.11) 2 = 25 + 24 + 22 + 20 + 2-1 + 2-2
» = 32 + 16 + 4 + 1 + 0.5 + 0.25
» = (53.75)10
Negative Exponents
 The exponent of a number says how many
times to use the number in a multiplication.
– In this example: 82 = 8 × 8 = 64
 In words: 82 can be called "8 to the second
power", "8 to the power 2" or simply "8
squared“.
 But those are positive exponents, what
about something like: 8-2.
– That exponent is negative ... what does it
mean?
• Example: 8-1 = 1 ÷ 81 = 1/8 = 0.125.
• Example: 2-2 = 1 ÷ 22 = 1/4 = 0.25.
• Example: 2-1 = 1 ÷ 21 = 1/2 = 0. 5.
The Binary Numbering System (Cont.)
 The following table shows the first 7 numbers obtained from 2
to the power n.
(Table) Powers of Two. n 2n
0 1
1 2
2 4
3 8
4 16
5 32
6 64
The Octal Numbering System
 r = 8 (23), allowed digits: {0, 1, 2, 3, ….., 7}.
– Example:
• (127.4)8 = ( ? )10
– Solution:
• (127.4)8 = 1*82 + 2*81 + 7*80 + 4*8-1
» = (87.5) 10
(Table) Powers of eight. n 8n
0 1
1 8
2 64
3 512
The Hexadecimal Numbering System
 r = 16 (24), allowed digits: {0, 1, 2, 3, ……, 9, A, B, C, D, E, F}.
– 10 → A
– 11 → B
– 12 → C
– 13 → D
– 14 → E
– 15 → F
• Example: (B65F)16 = ( ? )10
• Solution:
– (B65F)16 = 11 * 163 + 6 * 162 + 5 * 161 + 15 * 160
– = 11 * 4096 + 6 * 256 + 5 * 16 + 15 * 1
» = (46687)10
(Table) Powers of 16. n 16n
0 1
1 16
2 256
3 4096
Number Systems
 The following table shows
the representations of
numbers from (0)10 to
(16)10 in binary, octal, and
hexadecimal:
 Note: when the base
value increases (r↑), the
number of digits required
to represent the value
will decrease.
Conversion between Numbering Systems
1. Conversion from base (r) into decimal:
– Value = 𝑖=0
𝑛−1
𝐴𝑖 𝑟 𝑖
+ 𝑗=−𝑚
−1
𝐴𝑗 𝑟 𝑗
– Example: (312.4)5 = (?)10
• Solution:
» = 3 * 52 + 1 * 51 + 2 * 50 + 4 * 5-1
» = 75 + 5 + 2 + 0.8 = (82.8)10
Conversion between Numbering Systems (Cont.)
2. Conversion from base 10 to any base (r):
– For the integer part:
• Use repeated integer divisions on successive quotients with base
r and save the remainders until the quotient is 0. Then, read the
remainders from the bottom to the top.
– Example: (153)10 = (?)8 “Conversion of Decimal integers to Octal”
– Solution:
– Solution: (153)10 = (231)8
153 1 Least significant digit
19 3
2 2 Most significant digit
0
153 /8 = 19, remainder=1
19/8 = 2, remainder=3
2/8 = 0, remainder=2
Conversion between Numbering Systems (Cont.)
2. Conversion from base 10 to any base (r):
– For the integer part:
– Conversion of Decimal integers to binary
– Example: (73)10 = (?)2
– Solution: (73)10 = (1001001)2
73 1 Least significant digit (LSD)
36 0
18 0
9 1
4 0
2 0
1 1 Most significant digit (MSD)
0
Conversion between Numbering Systems (Cont.)
2. Conversion from base 10 to any base (r):
– For the integer part:
– Conversion of Decimal integers to Hexadecimal
– Example: (245)10 = (?)16
– Solution: (245)10 = (F5)16
245 5 Least significant digit (LSD)
15 15 Most significant digit (MSD)
0
Conversion between Numbering Systems (Cont.)
2. Conversion from base 10 to any base (r):
– For the integer part:
– For the fractional part:
• Use repeated multiplications with base r on the fractional
part and save the integer parts. Stop when the fraction is 0.
Then, read the integer parts from top to bottom.
• Example: (0.375)10 = (?)2
• Solution:
• Solution: (0.375)10 = (0.011)2
0.375 * 2 = 0.75 Integer part = 0 Most significant digit
0.75 * 2 = 1.5 Integer part = 1
0.5 * 2 = 1.0 Integer part = 1 Least significant digit
Conversion between Numbering Systems (Cont.)
2. Conversion from base 10 to any base (r):
– For the integer part:
– For the fractional part:
• Example: Convert (0.513)10 to a three-digit octal fraction.
• Note: The process of multiplying the fractions by r does not necessarily
end with zero. In this case, the number of digits of the fraction to be
used from the conversion must be specified.
• Solution: (0.513)10 = (0.4065)8
– The fourth digit (5) is used for rounding in base 8 of the second-to-
the-last digit (6).
• Solution: (0.513)10 = (0.407)8
0.513 * 8 = 4.104 Integer part = 4 Most significant digit
0.104 * 8 = 0.832 Integer part = 0
0.832 * 8 = 6.656 Integer part = 6
0.656 * 8 = 5.248 Integer part = 5 Least significant digit
Conversion between Numbering Systems (Cont.)
2. Conversion from base 10 to any base (r):
– For the integer part:
– For the fractional part:
• Example: (41.6875)10 = (?)2
• Solution: (41.6875)10 = (101001.1011)2
0.6875 * 2 = 1.375 Integer part = 1 MSD
0.375 * 2 = 0.75 Integer part = 0
0.75 * 2 = 1.5 Integer part = 1
0.5 * 2 = 1.0 Integer part = 1 LSD
41 1 Least significant digit
20 0
10 0
5 1
2 0
1 1 Most significant digit
0
Integer Part Fractional Part
Conversion between Numbering Systems (Cont.)
3. Conversion between octal and binary:
– First approach:
• Octal ↔ Decimal ↔ Binary.
– Example: (71)8 = (?)2
– (71)8 = (?)10;
– (71)8 = 7 * 81 + 1 * 80 = 56 + 1 = (57)10
– (57)10 =(111001)2.
– Second approach:
• A simpler and easier way to convert between octal and binary.
• In octal r = 8 = 23 . Hence each octal digit = 3 bits.
– Previous example “(71)8 = (?)2” resolved using the second approach:
– All you have to do is to convert each octal digit in its equivalent 3
bits.
57 1 Least significant digit
28 0
14 0
7 1
3 1
1 1 Most significant digit
0
Conversion between Numbering Systems (Cont.)
3. Conversion between octal and binary:
– Example: (11000011.0011)2 = (?)8
– All you have to do is to group each 3 bits in their
equivalent octal digit.
– Solution: (11000011.0011)2 = ( 303.14 )8
– Example : (7563.1102)8 = ( ? )2
– Solution: (111 101 110 011 . 001 001 000 010)2
Conversion between Numbering Systems (Cont.)
4. Conversion between hexadecimal and binary:
– In hexadecimal r = 16 = 24 .
– Hence each hexadecimal digit = 4 bits.
• Example: (F13.67)16 = ( ? )2
• Solution: (1111 0001 0011 . 0110 0111)2
• Example: (1101110001.110111)2 = ( ? )16
• Solution: (371.DC)16
Conversion between Numbering Systems (Cont.)
4. Conversion between hexadecimal and binary:
– Example: (D041.32)16 = ( ? )8
– Solution:
• (D041.32)16 = (1101 0000 0100 0001 . 0011 0010)2
• (D041.32)16 = ( 150101.144 )8
– Example: (365)r = (194)10; find r?
– Solution:
• 3r2 + 6r + 5 = 194
• 3r2 + 6r -189 = 0
• r2 + 2r – 63 = 0
• (r+9) (r-7) = 0
• So r = 7.
Arithmetic Operations
 The sum of two binary numbers is calculated following the
same rules as for decimal numbers,
– Except that the sum digit in any position can be only 1 or 0.
– Also, a carry in binary occurs if the sum in any bit position
is greater than 1.
• A carry in decimal occurs if the sum in any digit position
is greater than 9.
Inputs Outputs
A B Carry Sum
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0
• Examples of the addition of two binary
numbers are as follows (note the
names of the operands for addition):
Arithmetic Operations (Cont.)
 Example: Hexadecimal addition
 Perform the addition (59F)16 + (E46)16
Arithmetic Operations (Cont.)
 The rules for subtraction are the same as in decimal, except
that a borrow into a given column adds 2 to the minuend bit.
 A borrow in the decimal system adds 10 to the minuend digit.
Inputs Outputs
A B Borrow Difference
0 0 0 0
0 1 1 1
1 0 0 1
1 1 0 0
Arithmetic Operations (Cont.)
 The following are examples of the subtraction of two binary
numbers; as with addition, note the names of the operands:
 In the first example shown, no borrows occur, so the difference bits
are simply the minuend bits minus the subtrahend bits.
 In the second example, in the right position, the subtrahend bit
is 1 with the minuend bit 0, so it is necessary to borrow from
the second position as shown. This gives a difference bit in the first
position of 1 (2 + 0 - 1 = 1).
 In the second position, the borrow is subtracted, so a borrow is
again necessary.
Arithmetic Operations (Cont.)
 Recall that, in the event that the subtrahend is larger than the
minuend, we subtract the minuend from the subtrahend and
give the result a minus sign.
 This is the case in the third example, in which this interchange
of the two operands is shown.
Arithmetic Operations (Cont.)
 Subtraction with Complements
– The complement operation dictates that if
x= 1, then 𝑥 = 0.
– Example: Given the two binary numbers X
= 1010100 and Y = 1000011, perform
the subtraction
 (a) X - Y
 (b) Y - X by using 2’s complements.
• 1’s complement of Y “1000011” is
“0111100”.
• 2’s complement of Y “0111100” is
0111100 + 1 = 0111101.
1 1 1 1 1
X 1 0 1 0 1 0 0
Y 0 1 1 1 1 0 1
1 0 0 1 0 0 0 1
Discard end carry 27
Answer: X - Y =
0 0 1 0 0 0 1
Y 1 0 0 0 0 1 1
X 0 1 0 1 1 0 0
1 1 0 1 1 1 1
There is no end carry.
- 0 0 1 0 0 0 1
x 1 0 1 0 1 0 0
𝑥 0 1 0 1 0 1 1
+ 1
2’s complement =
0 1 0 1 1 0 0
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
x 1 0 1 0 1 0 0 84
y 1 0 0 0 0 1 1 67
Arithmetic Operations (Cont.)
 The final operation to be illustrated is binary multiplication,
which is quite simple.
 The multiplier digits are always 1 or 0.
 Therefore, the partial products are equal either to the
multiplicand or to 0.
 Multiplication is illustrated by the following example:
Binary Codes
 An n-bit binary code is a group of n bits that assume up to 2n
distinct combinations of 0’s and 1’s, with each combination
representing one element of the set being coded.
 For example the following codes can be used to encode the colors:
red, yellow, blue, green.
– Red: 00
– Yellow: 01
– Blue: 10
– Green: 11
 If we have n bits, then the maximum number of items that can be
encoded is m ≤ 2n.
 In general, in order to encode M elements we need: n (bits)=
[log2 𝑚] (items).
 For example, in order to encode 67 (4) elements we need 7 (2) bits.
 Binary codes can be classified into numeric codes and non-numeric
codes.
Binary Codes (Cont.)
 Binary is used to represent all types of data inside the digital system.
– Numeric or non-numeric.
 In general, in order to represent M items in binary, we need: n (bits)=
[log2 𝑚] (items).
 In other words, the number of items that can be encoded using n bits is
M=2n.
 Examples on binary codes:
» Binary Coded Decimal (BCD).
» American Standard Code for Information Interchange (ASCII).
» Uni-Code.
» Gray Code.
» Parity Code.
Binary Coded Decimal (BCD)
 A numeric code.
 Encodes the ten decimal digits in 4 bits. In other words,
each group of four bits represents one decimal digit.
 A number with n decimal digits will require 4*n bits in BCD.
 Binary combinations 1010 → 1111 are not used and have no
meaning in BCD. Thus, BCD is very similar to hexadecimal, but
BCD stops at 9.
 Example: convert the number (23)10 to binary and BCD.
– (23)10 = (10111)2 → requires 5 bits
– (23)10 = (0010 0011)BCD → requires 8 bits
 Example: convert the number (185)10 to binary and BCD.
– (185)10 = (10111001)2 → requires 8 bits
– (185)10 = (0001 1000 0101)BCD → requires 12 bits
Binary Coded Decimal (BCD) … (Cont.)
 (Table)
Binary-
Coded
Decimal
(BCD):
American Standard Code for Information
Interchange (ASCII)
 Non-numeric code.
 Uses 7 bits for encoding → 27 = 128 characters (items)
classified into:
– Printable characters:
• which includes the 10 decimal digits, the 26 uppercase
letters, the 26 lowercase letters, and 32 special
characters such as (, # @ ; .)
– Non-printable control characters: such as NULL, space,
carriage return, delete.
– Note: (2)ASCII + (3)ASCII ≠ (5)ASCII
Unicode
 Non-numeric code.
 Uses 16 bits for encoding → 216 = 64 K characters (64*1024).
Gray Code
 Non-numeric code.
 There is only one bit change between
adjacent codes.
 For example, in order to encode the
colors (red, yellow, blue, green) using
gray codes, the codes will be assigned
to the colors as follows:
– Red: 00
– Yellow: 01
– Blue: 11
– Green: 10
 The following table shows the binary
code and gray code as we count from
000 to 111 and the number of bits
changing between adjacent codes for
each code.
Parity Code
 Non-numeric code.
 Extra bit(s) added to the original data to aid error detection.
 In case of a single parity bit, an additional bit is added make
the total number of 1s in the resulting code either even or
odd.
 The following table shows an example of forming even and
odd parity. In each case, the extra parity bit is added in the
most significant position of the code.
Parity Code (Cont.)
 The parity bit is helpful in detecting errors during transmission
of information from one location to another.
 For example, assume even parity is used, the following steps
are performed between two end points that uses parity to
perform error detection:
– Even parity is generated at the sending end.
– Data is transmitted.
– Parity is checked at the destination. If it is odd, then the
system detects that at least one bit has changed.
 Such a system detects one, three, ….. odd number of errors.
 In order to detect errors more efficiently, more parity bits are
needed.
Chapter 1
Digital Systems and Information
Logic Circuits Design
Mutah University
Faculty of IT, Department of Software Engineering
Dr. Ra’Fat A. AL-msie’deen

Weitere ähnliche Inhalte

Was ist angesagt?

Microprogram Control
Microprogram Control Microprogram Control
Microprogram Control
Anuj Modi
 

Was ist angesagt? (20)

Counters
CountersCounters
Counters
 
Design and implementation of 32 bit alu using verilog
Design and implementation of 32 bit alu using verilogDesign and implementation of 32 bit alu using verilog
Design and implementation of 32 bit alu using verilog
 
Number Systems
Number SystemsNumber Systems
Number Systems
 
Number System
Number SystemNumber System
Number System
 
Binary codes
Binary codesBinary codes
Binary codes
 
Assembly language 8086
Assembly language 8086Assembly language 8086
Assembly language 8086
 
Bcd to excess 3 code converter
Bcd to excess 3 code converterBcd to excess 3 code converter
Bcd to excess 3 code converter
 
Parity generator & checker
Parity generator & checkerParity generator & checker
Parity generator & checker
 
Counter
CounterCounter
Counter
 
Combinational circuits
Combinational circuitsCombinational circuits
Combinational circuits
 
Chapter 8
Chapter 8Chapter 8
Chapter 8
 
Introduction of digital system
Introduction of digital systemIntroduction of digital system
Introduction of digital system
 
Number systems ppt
Number systems pptNumber systems ppt
Number systems ppt
 
encoder and decoder in digital electronics
encoder and decoder in digital electronicsencoder and decoder in digital electronics
encoder and decoder in digital electronics
 
7 Segment Decoder
7 Segment Decoder7 Segment Decoder
7 Segment Decoder
 
Binary codes
Binary codesBinary codes
Binary codes
 
Digital Logic & Design (DLD) presentation
Digital Logic & Design (DLD) presentationDigital Logic & Design (DLD) presentation
Digital Logic & Design (DLD) presentation
 
Microprogram Control
Microprogram Control Microprogram Control
Microprogram Control
 
decade counter
decade counterdecade counter
decade counter
 
Register transfer language & its micro operations
Register transfer language & its micro operationsRegister transfer language & its micro operations
Register transfer language & its micro operations
 

Ähnlich wie Logic Circuits Design - "Chapter 1: Digital Systems and Information"

100_2_digitalSystem_Chap1 (2).ppt
100_2_digitalSystem_Chap1 (2).ppt100_2_digitalSystem_Chap1 (2).ppt
100_2_digitalSystem_Chap1 (2).ppt
namraashraf56
 

Ähnlich wie Logic Circuits Design - "Chapter 1: Digital Systems and Information" (20)

Module 1 number systems and code1
Module 1  number systems and code1Module 1  number systems and code1
Module 1 number systems and code1
 
Chapter 1 digital design.pptx
Chapter 1 digital design.pptxChapter 1 digital design.pptx
Chapter 1 digital design.pptx
 
Digital logic design part1
Digital logic design part1Digital logic design part1
Digital logic design part1
 
Digital Electronics Notes
Digital Electronics Notes Digital Electronics Notes
Digital Electronics Notes
 
Chapter 1 Digital Systems and Binary Numbers.ppt
Chapter 1 Digital Systems and Binary Numbers.pptChapter 1 Digital Systems and Binary Numbers.ppt
Chapter 1 Digital Systems and Binary Numbers.ppt
 
DLD_Lecture_notes2.ppt
DLD_Lecture_notes2.pptDLD_Lecture_notes2.ppt
DLD_Lecture_notes2.ppt
 
DLD-Introduction.pptx
DLD-Introduction.pptxDLD-Introduction.pptx
DLD-Introduction.pptx
 
Digital Electronics Notes.pdf
Digital Electronics Notes.pdfDigital Electronics Notes.pdf
Digital Electronics Notes.pdf
 
Module 4
Module 4Module 4
Module 4
 
Boolean Algebra Arithmetic SIG UNSIGN.ppt
Boolean Algebra  Arithmetic SIG UNSIGN.pptBoolean Algebra  Arithmetic SIG UNSIGN.ppt
Boolean Algebra Arithmetic SIG UNSIGN.ppt
 
digi.elec.number%20system.pptx
digi.elec.number%20system.pptxdigi.elec.number%20system.pptx
digi.elec.number%20system.pptx
 
1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptx1.Digital Electronics overview & Number Systems.pptx
1.Digital Electronics overview & Number Systems.pptx
 
Chapter 3.pptx
Chapter 3.pptxChapter 3.pptx
Chapter 3.pptx
 
digital systems and information
digital systems and informationdigital systems and information
digital systems and information
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
 
DLD Chapter-1.pdf
DLD Chapter-1.pdfDLD Chapter-1.pdf
DLD Chapter-1.pdf
 
DCF QNA edited
DCF QNA editedDCF QNA edited
DCF QNA edited
 
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
FYBSC IT Digital Electronics Unit I Chapter I Number System and Binary Arithm...
 
100_2_digitalSystem_Chap1 (2).ppt
100_2_digitalSystem_Chap1 (2).ppt100_2_digitalSystem_Chap1 (2).ppt
100_2_digitalSystem_Chap1 (2).ppt
 
Digital electronics-Introduction.pptx
Digital electronics-Introduction.pptxDigital electronics-Introduction.pptx
Digital electronics-Introduction.pptx
 

Mehr von Ra'Fat Al-Msie'deen

BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports.pdf
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports.pdfBushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports.pdf
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports.pdf
Ra'Fat Al-Msie'deen
 
Software evolution understanding: Automatic extraction of software identifier...
Software evolution understanding: Automatic extraction of software identifier...Software evolution understanding: Automatic extraction of software identifier...
Software evolution understanding: Automatic extraction of software identifier...
Ra'Fat Al-Msie'deen
 
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug ReportsBushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
Ra'Fat Al-Msie'deen
 
Constructing a software requirements specification and design for electronic ...
Constructing a software requirements specification and design for electronic ...Constructing a software requirements specification and design for electronic ...
Constructing a software requirements specification and design for electronic ...
Ra'Fat Al-Msie'deen
 

Mehr von Ra'Fat Al-Msie'deen (20)

SoftCloud: A Tool for Visualizing Software Artifacts as Tag Clouds.pdf
SoftCloud: A Tool for Visualizing Software Artifacts as Tag Clouds.pdfSoftCloud: A Tool for Visualizing Software Artifacts as Tag Clouds.pdf
SoftCloud: A Tool for Visualizing Software Artifacts as Tag Clouds.pdf
 
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports.pdf
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports.pdfBushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports.pdf
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports.pdf
 
Software evolution understanding: Automatic extraction of software identifier...
Software evolution understanding: Automatic extraction of software identifier...Software evolution understanding: Automatic extraction of software identifier...
Software evolution understanding: Automatic extraction of software identifier...
 
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug ReportsBushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
 
Source Code Summarization
Source Code SummarizationSource Code Summarization
Source Code Summarization
 
FeatureClouds: Naming the Identified Feature Implementation Blocks from Softw...
FeatureClouds: Naming the Identified Feature Implementation Blocks from Softw...FeatureClouds: Naming the Identified Feature Implementation Blocks from Softw...
FeatureClouds: Naming the Identified Feature Implementation Blocks from Softw...
 
YamenTrace: Requirements Traceability - Recovering and Visualizing Traceabili...
YamenTrace: Requirements Traceability - Recovering and Visualizing Traceabili...YamenTrace: Requirements Traceability - Recovering and Visualizing Traceabili...
YamenTrace: Requirements Traceability - Recovering and Visualizing Traceabili...
 
Requirements Traceability: Recovering and Visualizing Traceability Links Betw...
Requirements Traceability: Recovering and Visualizing Traceability Links Betw...Requirements Traceability: Recovering and Visualizing Traceability Links Betw...
Requirements Traceability: Recovering and Visualizing Traceability Links Betw...
 
Automatic Labeling of the Object-oriented Source Code: The Lotus Approach
Automatic Labeling of the Object-oriented Source Code: The Lotus ApproachAutomatic Labeling of the Object-oriented Source Code: The Lotus Approach
Automatic Labeling of the Object-oriented Source Code: The Lotus Approach
 
Constructing a software requirements specification and design for electronic ...
Constructing a software requirements specification and design for electronic ...Constructing a software requirements specification and design for electronic ...
Constructing a software requirements specification and design for electronic ...
 
Detecting commonality and variability in use-case diagram variants
Detecting commonality and variability in use-case diagram variantsDetecting commonality and variability in use-case diagram variants
Detecting commonality and variability in use-case diagram variants
 
Naming the Identified Feature Implementation Blocks from Software Source Code
Naming the Identified Feature Implementation Blocks from Software Source CodeNaming the Identified Feature Implementation Blocks from Software Source Code
Naming the Identified Feature Implementation Blocks from Software Source Code
 
Application architectures - Software Architecture and Design
Application architectures - Software Architecture and DesignApplication architectures - Software Architecture and Design
Application architectures - Software Architecture and Design
 
Planning and writing your documents - Software documentation
Planning and writing your documents - Software documentationPlanning and writing your documents - Software documentation
Planning and writing your documents - Software documentation
 
Requirements management planning & Requirements change management
Requirements management planning & Requirements change managementRequirements management planning & Requirements change management
Requirements management planning & Requirements change management
 
Requirements change - requirements engineering
Requirements change - requirements engineeringRequirements change - requirements engineering
Requirements change - requirements engineering
 
Requirements validation - requirements engineering
Requirements validation - requirements engineeringRequirements validation - requirements engineering
Requirements validation - requirements engineering
 
Software Documentation - writing to support - references
Software Documentation - writing to support - referencesSoftware Documentation - writing to support - references
Software Documentation - writing to support - references
 
Algorithms - "heap sort"
Algorithms - "heap sort"Algorithms - "heap sort"
Algorithms - "heap sort"
 
Algorithms - "quicksort"
Algorithms - "quicksort"Algorithms - "quicksort"
Algorithms - "quicksort"
 

Kürzlich hochgeladen

Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 

Kürzlich hochgeladen (20)

NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 

Logic Circuits Design - "Chapter 1: Digital Systems and Information"

  • 1. Chapter 1 Digital Systems and Information Logic Circuits Design Mutah University Faculty of IT, Department of Software Engineering Dr. Ra’Fat A. AL-msie’deen
  • 2. Course Info  Course title: Logic Circuits Design.  Credit hours (theory, practical): 3 hours.  Instructor: Dr. Ra’Fat A. AL-msie’Deen.
  • 3. Required Textbook  Logic and Computer Design Fundamentals. – Fifth Edition. – M. Morris Mano, Charles R. Kime, Tom Martin. – 2014.
  • 5. Information Representation  Digital systems store, move, and process information.  Information represents a broad range of phenomena from: – The physical world: • Characterized by parameters such as weight, temperature, and frequency. • Most physical parameters are continuous: capable of taking on all possible values over a defined range. – Man-made world: • Such as business records using words, quantities, and currencies. • Parameters are discrete in nature.  In general, information systems must be able to represent both continuous and discrete information.
  • 6. Information Representation (Cont.)  The signals in most present-day electronic digital systems use just two discrete values and are therefore said to be binary.  The two discrete values used are often called 0 and 1, the digits for the binary number system. (Figure) Examples of Voltage Ranges and Waveforms for Binary Signals.
  • 7. Information is represented using signals.  Electrical signals such as voltages and currents are the most common.  There are two types of signals: – Analog signals represent information that is continuous in time and value. – Digital signals represent information that is discrete in time and value.
  • 8. What is a digital system?  It is a system that manipulates (processes) discrete elements of information.  A digital system is a discrete information processing system.  Examples of digital systems: – the calculator, – digital voltmeters, – and general purpose computers.  In such systems, all quantities are represented using two values.  Note: if the system in Not Digital, it is "Analog".
  • 9. What is A/D conversion?  To process analog data using a digital system, we need analog to digital (A/D) conversion.  There are two main steps in order to discretize a signal: – Sampling: taking finite samples in time (discretize in time). Samples are taken by measuring the value of the signal at regular time intervals. – Quantization: taking finite values (discretize in value).  Sampling + quantization + encoding ≡ ADC ≡ A/D ≡ Analog to digital conversion
  • 10. What is A/D conversion? (Cont.)
  • 11. What is A/D conversion? (Cont.)  How many values to consider when quantizing data? – Multi-valued quantization. – Binary-valued quantization  Example: Comparison between multi-valued and binary- valued quantization assuming that the voltage range is 0-3. Voltage Multi-valued Binary-valued 0-0.5 0 000 0.5-1 1 001 (encoding) 1-1.5 2 010 1.5-2 3 011 2-2.5 4 100 2.5-3 5 101 Sample value Digital Multi-valued logic Digital binary
  • 12. What is A/D conversion? (Cont.)  Note that in order to transfer data in case of multi-valued quantization, we need fewer wires.  In this example, the multi-valued quantized data requires one wire whereas binary-valued quantized data requires three wires.  However, binary quantization is preferred over multi- valued quantization since it provides higher immunity to noise.  In general, binary systems are preferred since they are simpler, easy to design, and extremely reliable.  Note: Always keep in mind that digital does not mean binary.
  • 13. The Digital Computer  General-Purpose Computers are an example of binary systems.  A block diagram of a digital computer is shown in Figure below.
  • 14. The Digital Computer  The memory stores programs as well as input, output, ….  The datapath (ALU) performs arithmetic and other data- processing operations as specified by the program.  The control unit supervises the flow of information between the various units.  A datapath, when combined with the control unit, forms a component referred to as a central processing unit, or CPU.  Input device: keyboard.  Output device: LCD (liquid crystal display). – These devices use digital logic circuits
  • 15. Digital logic  Digital logic: is a science that deals with circuits that operate on a set of two-valued elements; binary values.
  • 16. Digital logic (Cont.)  Physical quantities: continuous.  Signal: mathematical function that describes physical quantities.  Digital signal: discrete in time and finite.  Analog signal: infinite values.  Again: why digital? – Analog has errors. – Digital systems have excellent noise immunity.  Most real life signals are analog signals (continuous)
  • 17. Number Systems  We will deal with different systems.  The systems of numbering we consider are positional positive radix (base) system.  In general the structure of any number in base r:  Where A is any value in [0, r-1]. – Base 5 → [0 - 4] Least Significant Digit (LSD)Most Significant Digit (MSD)
  • 18. The Binary Numbering System  The binary number system is a base 2 system with two digits: 0 and 1.  A binary digit is called a bit.  bit - binary digit.  The decimal equivalent of a binary number can be found by expanding the number into a power series with a base of 2. – For example, – (11010)2 = 1 * 24 + 1 * 23 + 0 * 22 + 1 * 21 + 0 * 20 = (26)10
  • 19. The Binary Numbering System (Cont.)  The digits in a binary number are called bits.  When a bit is equal to 0, it does not contribute to the sum during the conversion.  Therefore, the conversion to decimal can be obtained by adding the numbers with powers of two corresponding to the bits that are equal to 1. – For example, • (110101.11)2 = ( ? )10 – Solution: • (110101.11) 2 = 25 + 24 + 22 + 20 + 2-1 + 2-2 » = 32 + 16 + 4 + 1 + 0.5 + 0.25 » = (53.75)10
  • 20. Negative Exponents  The exponent of a number says how many times to use the number in a multiplication. – In this example: 82 = 8 × 8 = 64  In words: 82 can be called "8 to the second power", "8 to the power 2" or simply "8 squared“.  But those are positive exponents, what about something like: 8-2. – That exponent is negative ... what does it mean? • Example: 8-1 = 1 ÷ 81 = 1/8 = 0.125. • Example: 2-2 = 1 ÷ 22 = 1/4 = 0.25. • Example: 2-1 = 1 ÷ 21 = 1/2 = 0. 5.
  • 21. The Binary Numbering System (Cont.)  The following table shows the first 7 numbers obtained from 2 to the power n. (Table) Powers of Two. n 2n 0 1 1 2 2 4 3 8 4 16 5 32 6 64
  • 22. The Octal Numbering System  r = 8 (23), allowed digits: {0, 1, 2, 3, ….., 7}. – Example: • (127.4)8 = ( ? )10 – Solution: • (127.4)8 = 1*82 + 2*81 + 7*80 + 4*8-1 » = (87.5) 10 (Table) Powers of eight. n 8n 0 1 1 8 2 64 3 512
  • 23. The Hexadecimal Numbering System  r = 16 (24), allowed digits: {0, 1, 2, 3, ……, 9, A, B, C, D, E, F}. – 10 → A – 11 → B – 12 → C – 13 → D – 14 → E – 15 → F • Example: (B65F)16 = ( ? )10 • Solution: – (B65F)16 = 11 * 163 + 6 * 162 + 5 * 161 + 15 * 160 – = 11 * 4096 + 6 * 256 + 5 * 16 + 15 * 1 » = (46687)10 (Table) Powers of 16. n 16n 0 1 1 16 2 256 3 4096
  • 24. Number Systems  The following table shows the representations of numbers from (0)10 to (16)10 in binary, octal, and hexadecimal:  Note: when the base value increases (r↑), the number of digits required to represent the value will decrease.
  • 25. Conversion between Numbering Systems 1. Conversion from base (r) into decimal: – Value = 𝑖=0 𝑛−1 𝐴𝑖 𝑟 𝑖 + 𝑗=−𝑚 −1 𝐴𝑗 𝑟 𝑗 – Example: (312.4)5 = (?)10 • Solution: » = 3 * 52 + 1 * 51 + 2 * 50 + 4 * 5-1 » = 75 + 5 + 2 + 0.8 = (82.8)10
  • 26. Conversion between Numbering Systems (Cont.) 2. Conversion from base 10 to any base (r): – For the integer part: • Use repeated integer divisions on successive quotients with base r and save the remainders until the quotient is 0. Then, read the remainders from the bottom to the top. – Example: (153)10 = (?)8 “Conversion of Decimal integers to Octal” – Solution: – Solution: (153)10 = (231)8 153 1 Least significant digit 19 3 2 2 Most significant digit 0 153 /8 = 19, remainder=1 19/8 = 2, remainder=3 2/8 = 0, remainder=2
  • 27. Conversion between Numbering Systems (Cont.) 2. Conversion from base 10 to any base (r): – For the integer part: – Conversion of Decimal integers to binary – Example: (73)10 = (?)2 – Solution: (73)10 = (1001001)2 73 1 Least significant digit (LSD) 36 0 18 0 9 1 4 0 2 0 1 1 Most significant digit (MSD) 0
  • 28. Conversion between Numbering Systems (Cont.) 2. Conversion from base 10 to any base (r): – For the integer part: – Conversion of Decimal integers to Hexadecimal – Example: (245)10 = (?)16 – Solution: (245)10 = (F5)16 245 5 Least significant digit (LSD) 15 15 Most significant digit (MSD) 0
  • 29. Conversion between Numbering Systems (Cont.) 2. Conversion from base 10 to any base (r): – For the integer part: – For the fractional part: • Use repeated multiplications with base r on the fractional part and save the integer parts. Stop when the fraction is 0. Then, read the integer parts from top to bottom. • Example: (0.375)10 = (?)2 • Solution: • Solution: (0.375)10 = (0.011)2 0.375 * 2 = 0.75 Integer part = 0 Most significant digit 0.75 * 2 = 1.5 Integer part = 1 0.5 * 2 = 1.0 Integer part = 1 Least significant digit
  • 30. Conversion between Numbering Systems (Cont.) 2. Conversion from base 10 to any base (r): – For the integer part: – For the fractional part: • Example: Convert (0.513)10 to a three-digit octal fraction. • Note: The process of multiplying the fractions by r does not necessarily end with zero. In this case, the number of digits of the fraction to be used from the conversion must be specified. • Solution: (0.513)10 = (0.4065)8 – The fourth digit (5) is used for rounding in base 8 of the second-to- the-last digit (6). • Solution: (0.513)10 = (0.407)8 0.513 * 8 = 4.104 Integer part = 4 Most significant digit 0.104 * 8 = 0.832 Integer part = 0 0.832 * 8 = 6.656 Integer part = 6 0.656 * 8 = 5.248 Integer part = 5 Least significant digit
  • 31. Conversion between Numbering Systems (Cont.) 2. Conversion from base 10 to any base (r): – For the integer part: – For the fractional part: • Example: (41.6875)10 = (?)2 • Solution: (41.6875)10 = (101001.1011)2 0.6875 * 2 = 1.375 Integer part = 1 MSD 0.375 * 2 = 0.75 Integer part = 0 0.75 * 2 = 1.5 Integer part = 1 0.5 * 2 = 1.0 Integer part = 1 LSD 41 1 Least significant digit 20 0 10 0 5 1 2 0 1 1 Most significant digit 0 Integer Part Fractional Part
  • 32. Conversion between Numbering Systems (Cont.) 3. Conversion between octal and binary: – First approach: • Octal ↔ Decimal ↔ Binary. – Example: (71)8 = (?)2 – (71)8 = (?)10; – (71)8 = 7 * 81 + 1 * 80 = 56 + 1 = (57)10 – (57)10 =(111001)2. – Second approach: • A simpler and easier way to convert between octal and binary. • In octal r = 8 = 23 . Hence each octal digit = 3 bits. – Previous example “(71)8 = (?)2” resolved using the second approach: – All you have to do is to convert each octal digit in its equivalent 3 bits. 57 1 Least significant digit 28 0 14 0 7 1 3 1 1 1 Most significant digit 0
  • 33. Conversion between Numbering Systems (Cont.) 3. Conversion between octal and binary: – Example: (11000011.0011)2 = (?)8 – All you have to do is to group each 3 bits in their equivalent octal digit. – Solution: (11000011.0011)2 = ( 303.14 )8 – Example : (7563.1102)8 = ( ? )2 – Solution: (111 101 110 011 . 001 001 000 010)2
  • 34. Conversion between Numbering Systems (Cont.) 4. Conversion between hexadecimal and binary: – In hexadecimal r = 16 = 24 . – Hence each hexadecimal digit = 4 bits. • Example: (F13.67)16 = ( ? )2 • Solution: (1111 0001 0011 . 0110 0111)2 • Example: (1101110001.110111)2 = ( ? )16 • Solution: (371.DC)16
  • 35. Conversion between Numbering Systems (Cont.) 4. Conversion between hexadecimal and binary: – Example: (D041.32)16 = ( ? )8 – Solution: • (D041.32)16 = (1101 0000 0100 0001 . 0011 0010)2 • (D041.32)16 = ( 150101.144 )8 – Example: (365)r = (194)10; find r? – Solution: • 3r2 + 6r + 5 = 194 • 3r2 + 6r -189 = 0 • r2 + 2r – 63 = 0 • (r+9) (r-7) = 0 • So r = 7.
  • 36. Arithmetic Operations  The sum of two binary numbers is calculated following the same rules as for decimal numbers, – Except that the sum digit in any position can be only 1 or 0. – Also, a carry in binary occurs if the sum in any bit position is greater than 1. • A carry in decimal occurs if the sum in any digit position is greater than 9. Inputs Outputs A B Carry Sum 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0 • Examples of the addition of two binary numbers are as follows (note the names of the operands for addition):
  • 37. Arithmetic Operations (Cont.)  Example: Hexadecimal addition  Perform the addition (59F)16 + (E46)16
  • 38. Arithmetic Operations (Cont.)  The rules for subtraction are the same as in decimal, except that a borrow into a given column adds 2 to the minuend bit.  A borrow in the decimal system adds 10 to the minuend digit. Inputs Outputs A B Borrow Difference 0 0 0 0 0 1 1 1 1 0 0 1 1 1 0 0
  • 39. Arithmetic Operations (Cont.)  The following are examples of the subtraction of two binary numbers; as with addition, note the names of the operands:  In the first example shown, no borrows occur, so the difference bits are simply the minuend bits minus the subtrahend bits.  In the second example, in the right position, the subtrahend bit is 1 with the minuend bit 0, so it is necessary to borrow from the second position as shown. This gives a difference bit in the first position of 1 (2 + 0 - 1 = 1).  In the second position, the borrow is subtracted, so a borrow is again necessary.
  • 40. Arithmetic Operations (Cont.)  Recall that, in the event that the subtrahend is larger than the minuend, we subtract the minuend from the subtrahend and give the result a minus sign.  This is the case in the third example, in which this interchange of the two operands is shown.
  • 41. Arithmetic Operations (Cont.)  Subtraction with Complements – The complement operation dictates that if x= 1, then 𝑥 = 0. – Example: Given the two binary numbers X = 1010100 and Y = 1000011, perform the subtraction  (a) X - Y  (b) Y - X by using 2’s complements. • 1’s complement of Y “1000011” is “0111100”. • 2’s complement of Y “0111100” is 0111100 + 1 = 0111101. 1 1 1 1 1 X 1 0 1 0 1 0 0 Y 0 1 1 1 1 0 1 1 0 0 1 0 0 0 1 Discard end carry 27 Answer: X - Y = 0 0 1 0 0 0 1 Y 1 0 0 0 0 1 1 X 0 1 0 1 1 0 0 1 1 0 1 1 1 1 There is no end carry. - 0 0 1 0 0 0 1 x 1 0 1 0 1 0 0 𝑥 0 1 0 1 0 1 1 + 1 2’s complement = 0 1 0 1 1 0 0 27 26 25 24 23 22 21 20 128 64 32 16 8 4 2 1 x 1 0 1 0 1 0 0 84 y 1 0 0 0 0 1 1 67
  • 42. Arithmetic Operations (Cont.)  The final operation to be illustrated is binary multiplication, which is quite simple.  The multiplier digits are always 1 or 0.  Therefore, the partial products are equal either to the multiplicand or to 0.  Multiplication is illustrated by the following example:
  • 43. Binary Codes  An n-bit binary code is a group of n bits that assume up to 2n distinct combinations of 0’s and 1’s, with each combination representing one element of the set being coded.  For example the following codes can be used to encode the colors: red, yellow, blue, green. – Red: 00 – Yellow: 01 – Blue: 10 – Green: 11  If we have n bits, then the maximum number of items that can be encoded is m ≤ 2n.  In general, in order to encode M elements we need: n (bits)= [log2 𝑚] (items).  For example, in order to encode 67 (4) elements we need 7 (2) bits.  Binary codes can be classified into numeric codes and non-numeric codes.
  • 44. Binary Codes (Cont.)  Binary is used to represent all types of data inside the digital system. – Numeric or non-numeric.  In general, in order to represent M items in binary, we need: n (bits)= [log2 𝑚] (items).  In other words, the number of items that can be encoded using n bits is M=2n.  Examples on binary codes: » Binary Coded Decimal (BCD). » American Standard Code for Information Interchange (ASCII). » Uni-Code. » Gray Code. » Parity Code.
  • 45. Binary Coded Decimal (BCD)  A numeric code.  Encodes the ten decimal digits in 4 bits. In other words, each group of four bits represents one decimal digit.  A number with n decimal digits will require 4*n bits in BCD.  Binary combinations 1010 → 1111 are not used and have no meaning in BCD. Thus, BCD is very similar to hexadecimal, but BCD stops at 9.  Example: convert the number (23)10 to binary and BCD. – (23)10 = (10111)2 → requires 5 bits – (23)10 = (0010 0011)BCD → requires 8 bits  Example: convert the number (185)10 to binary and BCD. – (185)10 = (10111001)2 → requires 8 bits – (185)10 = (0001 1000 0101)BCD → requires 12 bits
  • 46. Binary Coded Decimal (BCD) … (Cont.)  (Table) Binary- Coded Decimal (BCD):
  • 47. American Standard Code for Information Interchange (ASCII)  Non-numeric code.  Uses 7 bits for encoding → 27 = 128 characters (items) classified into: – Printable characters: • which includes the 10 decimal digits, the 26 uppercase letters, the 26 lowercase letters, and 32 special characters such as (, # @ ; .) – Non-printable control characters: such as NULL, space, carriage return, delete. – Note: (2)ASCII + (3)ASCII ≠ (5)ASCII
  • 48. Unicode  Non-numeric code.  Uses 16 bits for encoding → 216 = 64 K characters (64*1024).
  • 49. Gray Code  Non-numeric code.  There is only one bit change between adjacent codes.  For example, in order to encode the colors (red, yellow, blue, green) using gray codes, the codes will be assigned to the colors as follows: – Red: 00 – Yellow: 01 – Blue: 11 – Green: 10  The following table shows the binary code and gray code as we count from 000 to 111 and the number of bits changing between adjacent codes for each code.
  • 50. Parity Code  Non-numeric code.  Extra bit(s) added to the original data to aid error detection.  In case of a single parity bit, an additional bit is added make the total number of 1s in the resulting code either even or odd.  The following table shows an example of forming even and odd parity. In each case, the extra parity bit is added in the most significant position of the code.
  • 51. Parity Code (Cont.)  The parity bit is helpful in detecting errors during transmission of information from one location to another.  For example, assume even parity is used, the following steps are performed between two end points that uses parity to perform error detection: – Even parity is generated at the sending end. – Data is transmitted. – Parity is checked at the destination. If it is odd, then the system detects that at least one bit has changed.  Such a system detects one, three, ….. odd number of errors.  In order to detect errors more efficiently, more parity bits are needed.
  • 52. Chapter 1 Digital Systems and Information Logic Circuits Design Mutah University Faculty of IT, Department of Software Engineering Dr. Ra’Fat A. AL-msie’deen