0% found this document useful (0 votes)
13 views121 pages

Chapter1 Log New 25

The document outlines a course on Digital Logic Design, focusing on fundamental concepts such as number systems, binary arithmetic, Boolean algebra, and digital logic gates. It includes a detailed course outline with chapters on digital systems, binary numbers, gate minimization, and combinational logic. Recommended readings include 'Digital Design with an Introduction to The VERILOG HDL' by M. Morris Mano & Michael D. Ciletti.

Uploaded by

mm85rz8t9g
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views121 pages

Chapter1 Log New 25

The document outlines a course on Digital Logic Design, focusing on fundamental concepts such as number systems, binary arithmetic, Boolean algebra, and digital logic gates. It includes a detailed course outline with chapters on digital systems, binary numbers, gate minimization, and combinational logic. Recommended readings include 'Digital Design with an Introduction to The VERILOG HDL' by M. Morris Mano & Michael D. Ciletti.

Uploaded by

mm85rz8t9g
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 121

Digital Logic Design

Faculty of Information Technology - Computer Science Department 2


Outline

• Recommended Text Book


Digital Design with an Introduction To The VERILOG HDL , by M.Morris Mano &
Michael D. Ciletti, 5th edition, Pearson, 2013.

• Course Description
This course focuses on the fundamental constructs and concepts underlying
computer hardware and software which includes: number systems, binary
arithmetic, codes, Boolean algebra, gates, Boolean expressions

Faculty of Information Technology - Computer Science Department 2


Course Outline

Chapter 1:Digital Systems and Binary Number systems


1. Binary Numbers.
2. Octal and Hexadecimal Numbers. Number-Base Conversions.
3. Arithmetic Operations.
4. Complements.
5. Signed Binary Numbers.
6. Binary Codes.

Faculty of Information Technology - Computer Science Department 3


Course Outline

Chapter 2: Boolean algebra


1. Basic Theorems and properties of Boolean Algebra.
2. Boolean Functions.
3. Canonical and standard forms( Minterm, Maxterm).
4. Digital logic gates.

Faculty of Information Technology - Computer Science Department 4


Course Outline

Chapter 3:Gate Minimization


1. The Map Method.
2. Two, three, and four variable maps.
3. PoS, SoP simplification.
4. Don’t care conditions. NAND/NOR implementation.
5. Exclusive-OR Function.

Chapter 4: Combinational Logic


1. Analysis and design combinational circuits
2. Full/half adder
Chapter 1
Digital Systems and Binary
Numbers

Faculty of Information Technology - Computer Science Department 6


Outline of Chapter 1

1. Digital Systems
2. Binary Numbers
3. Number‐Base Conversions
4. Octal and Hexadecimal Numbers
5. Arithmetic Operations
6. Complements of Numbers
7. Signed Binary Numbers
8. Binary Codes
9. Binary Storage and Registers
10. Binary Logic
Analog and Digital Signal
Analog system‫االشاره التناضريه‬
The physical quantities or signals may vary continuously over a specified range.

Digital system ‫االشاره الرقميه‬

The physical quantities or signals can assume only discrete values.


Digital Systems

Digital systems (systems that can manipulate Discrete information)


◆ Digital System are used in many scientific, industrial and
commercial application .
◆ We have :

1. Digital Computers
2. Telephone switching exchanges
3. Digital camera
4. Electronic calculators, PDA's Digital TV
Digital Systems

Why Digital systems are better?


◆ Digital Systems are programmable
◆ Dramatic cost reductions due to advances in digital ICs
technology
◆ High speed operations hundreds of millions OPS
◆ Digital Systems work with extreme reliability
Digital Systems

• digital systems manipulate discrete quantities of information


that are represented in binary form. Operands used for
calculations may be expressed

• in the binary number system. Other discrete elements, including


the decimal digits and characters of the alphabet, are represented
in binary codes.

• The purpose of this chapter is to introduce the various binary


concepts as a frame of reference for further study in the
succeeding chapters.
Binary Numbers
Decimal Number
— A decimal number such as 7,392 represents a quantity equal to 7
thousands, plus 3 hundreds, plus 9 tens, plus 2 units.
— The thousands, hundreds, etc., are powers of 10 implied by the
position of the coefficients (symbols) in the number.
— To be more exact, 7,392 is a shorthand notation for what should be written as
Decimal Number System

Base (also called radix) = 10


◆ 10 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }

Coefficient Position
◆ Integer & fraction

Coefficient Weight
◆ Weight = (Base) Position

In general Magnitude:
◆ Sum of “Coefficient x Weight”
Binary Numbers

• An information variable represented by physical quantity.


• For digital systems, the variable takes on discrete values.
Two level, or binary values are the most prevalent values.

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 Numbers
• 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.

• Computer capacity is usually given in bytes.

• A byte is equal to eight bits and can accommodate one


keyboard character.
Binary Number System

Base = 2
◆ 2 digits { 0, 1 }, called binary digits or “bits”
Weights
◆ Weight = (Base) Position

Magnitude
◆ Sum of “Bit x Weight”
Formal Notation
Groups of bits
The Power of 2
Octal Number System

Base = 8
◆ 8 digits { 0, 1, 2, 3, 4, 5, 6, 7 }
Weights
◆ Weight = (Base) Position
Magnitude
◆ Sum of “Digit x Weight”
Formal Notation
Hexadecimal Number System

Base = 16
◆ 16 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F }
Weights
◆ Weight = (Base) Position

Magnitude
◆ Sum of “Digit x Weight”
Formal Notation
Number Base Conversions

Decimal to other base system Steps


1. Divide the decimal number to be converted by the value of the new base.
2. Get the remainder from Step 1 as the rightmost digit (least significant digit) of new base
number.
3. Divide the quotient of the previous divide by the new base.
4. Record the remainder from Step 3 as the next digit (to the left) of the new base number.
5. Repeat Steps 3 and 4, getting remainders from right to left, until the quotient becomes zero
in Step 3.
Conversion form Decimal to any base system (Divide by base)

1. To convert a decimal integer into any base, keep dividing by r until the quotient is 0.
Collect the remainders in reverse order.
2. To convert a fraction, keep multiplying the fractional part by r until it becomes 0 or
until we reach the required accuracy. Collect the integer parts in forward order.
Decimal (Integer) to Binary Conversion

Divide the number by the ‘Base’ (=2)


Take the remainder (either 0 or 1) as a coefficient Take the quotient
repeat the division until the quotient reaches zero.
Example: (13)10
Decimal (Integer) to Binary Conversion

1- Convert (29)10 to binary

2- Convert (56)10 to binary ??


Decimal (Fraction) to Binary Conversion

Multiply the number by the ‘Base’ (=2)


• Take the integer (either 0 or 1) as a coefficient
• Take the resultant fraction
• repeat till you reach a zero or the required accuracy is
attained.
Decimal (Fraction) to Binary Conversion
Decimal to Octal Conversion
Decimal to Octal Conversion
Decimal to Octal Conversion
Decimal to Hexadecimal Conversion
Decimal to Hexadecimal Conversion

Example: Convert the number 256 DECIMAL to HEXADECIMAL

DIVISION RESULT REMAINDER (in HEX)


256 / 16 16 0
16 / 16 1 0
1 / 16 0 1

ANSWER 100
Decimal to Hexadecimal Conversion

Example: Convert the number 921 DECIMAL to HEXADECIMA

DIVISION RESULT REMAINDER (in HEX)


921 / 16 57 9
57 / 16 3 9
3 / 16 0 3

ANSWER 399
Decimal to Hexadecimal Conversion

Example: Convert the number 188 DECIMAL to HEXADECIMAL

DIVISION RESULT REMAINDER (in HEX)


188 / 16 11 C (12 decimal)
11 / 16 0 B (11 decimal)

ANSWER BC
Conversion form any base to Decimal (Evaluate magnitude)
Conversion form binary to Decimal (Evaluate magnitude)
To convert a binary number to a decimal number, you can follow these steps:
1.Start with the rightmost digit of the binary number.
2.Multiply this digit by the corresponding power of 2.
3.Repeat steps 1 and 2 for each digit in the binary number.
4.Add the results of all the multiplications to get the decimal number.

For example, to convert the binary number 1101 to decimal, we would follow these
steps: 1.Write the binary number down: 1101
2.Starting from the rightmost digit, multiply each digit by the corresponding
power of 2:
1. 1×20=1
2. 0×21=0
3. 1×22=4
4. 1×23=8
3.Add the results together: 1 + 0 + 4 + 8 = 13
4.The final result is the decimal equivalent of the binary number: 13
Conversion form binary to Decimal (Evaluate magnitude)

Example: convert 1101.01 in binary to decimal:

The decimal value is:


Conversion form binary to Octal
Binary to Octal Conversion using Grouping Method
Because the octal number system has only eight digits (from 0 to 7), we may
express each octal digit using only three bits, as seen in the table below.
Octal Digit Binary
Example : Convert binary number 1010111100 into an Value Equivalent

octal number. 0 000

Therefore, Binary to octal is. 1 001


2 010
= (1010111100)
3 011
= (001 010 111 100) 4 100

= (1 2 7 4) 5 101
6 110
= (1274)
Conversion form binary to Octal

Example: Convert binary number 0110011.1011 into octal number.


Conversion form binary to Octal

Example : Convert binary number 01110101 into octal numbe


Conversion form binary to Hexadecimal
Binary Hexadecimal
0000 0
• We can represent a group of any 4 binary digits using
0001 1
a unique hexadecimal value.
0010 2
• Simply divide the given binary number into the
0011 3
groups of 4. 0100 4
• Add zeros to the left when there are not enough 0101 5
digits to form a group. 0110 6
• Convert each group into the equivalent hexadecimal 0111 7
number using the following binary to hexadecimal 1000 8

table. 1001 9
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F
Conversion form binary to Hexadecimal

Example: Convert the binary number (10101011)2 into hexadecimal.


Let’s create groups of 4 digits starting from the ones place.
101010112 = 10102 | 10112
From the table, we have
10102 = A16
10112 = B16
Thus, 101010112 = (AB)16
Example: Convert (00001011)2 into a hexadecimal number system

Let’s form the groups of four digits.


(00001011)2 = (0000) | (1011)
Here,
00002 = 016
10112 = B16
So, (00001011)2=(0B)16
Conversion form Octal to Hexadecimal
We can convert the octal number system into the hexadecimal number system.

1. Convert the octal number into binary and then convert the binary into hexadecimal.

2. Convert the octal number into decimal and then convert the decimal into hexadecimal.
Conversion form binary to Hexadecimal
Example :Convert (56)8 into hexadecimal
Step 1 : Convert (56)8 into Binary
In order to convert the octal number into binary, we need to express every octal value
using 3 binary bits.
Binary equivalent of 5 is (101)2.
Binary equivalent of 6 is (110)2.
= (56)8
= (101)(110)
= (101110)2
Step 2 : Convert (101110)2 into Hexadecimal
In order to convert the binary number into hexadecimal, we need to group every 4 binary bits and calculate
the value[From left to right].
(101110)2 in hexadecimal
= (101110)2
= (10)(1110)
= (2)(14)
= (2E)16
Conversion form Octal to Hexadecimal

• What is the hexadecimal equivalent of (50)8


As the result the hexadecimal equivalent of (50)8=(28)16

• Example:Convert 536 from octal to hexadecimal number:


(101011110)2= (0001) (0101) (1110) = (15E)16
Conversion form Hexadecimal to Octal
•For each given hexadecimal number digit, write the equivalent
binary number. If any of the binary equivalents are less than 4
digits, add 0’s to the left side.
•Combine and make the groups of binary digits from right to left,
each containing 3 digits. Add 0’s to the left if there are less than 3
digits in the last group.
•Find the octal equivalent of each binary group.
Conversion form Hexadecimal to Octal

• Example: Convert 1BC16 into an octal number.


Hence, 1BC16 = 6748

• Example :Find the equivalent octal form of C116.


Hence, C116 = 3018
Number Base Conversions
Example:
Example:
Exercise
Exercise
Exercise
Exercise
Arithmetic Operations

1. Procedure to add two base-r numbers


2. Procedure to subtract two base-r numbers
3. Multiplication of two base-r numbers
Example 1
Single Bit Binary Addition

In general, the result of adding two digits each of weight w is two digits. One is the “Sum”
digit and the other is the “Carry” digit.

In binary system, if the weight of the sum bit is 2i, then the weight of
the carry bit is 2i+1. Thus, adding 1 + 1 in the binary system results in
a Sum bit of 0 and a carry bit of
Single Bit Binary Addition

Q. What is 1 + 1 + 1 = ?
A. The answer is 1 carry 1.

Explanation: We perform the operation in 2 steps: 1 + 1 =


0 carry 1
We then add 1 to the above result, which yields
is 1 carry 1.

Faculty of Information Technology - Computer Science Department 5


7
Example
Multiple Bit Binary Addition

• Start with the least significant bit (rightmost bit)


• Add each pair of bits
• Include the carry in the addition, if present
• Example :

Faculty of Information Technology - Computer Science Department 5


9
Multiple Bit Binary Addition

Another Example:

Faculty of Information Technology - Computer Science Department 6


0
Solve :
1. Procedure to add two base-r numbers
2. Procedure to subtract two base-r numbers
3. Multiplication of two base-r numbers
Single Bit Binary Subtraction

• In general, the result of subtracting two digits each


of weight w is two digits. One is the “Difference”
digit and the other is the “Borrow” digit.
• The difference digit has the same weight w as the
operand digits.
• The borrow digit is considered negative and has the
weight of the next higher digit .
If Difference is negative Difference = 2 + Difference &
Borrow = -1
Single Bit Binary Subtraction

Q. What is1–1–1=?
A. The answer is 1 borrow 1.
Explanation: We perform the operation in 2 steps: 1 – 1 = 0
We then subtract 1 from the above result, i.e. 0 – 1 which is
1 borrow 1.
Q. What is 0 – 1 – 1 = ?
A. The answer is 0 borrow 1. Explanation: We perform the
operation 0 - 1= 1 borrow 1
We then subtract 1 from the above result, which yields 0
borrow 1.

Faculty of Information Technology - Computer Science Department 64


Multiple Bit Binary Subtraction
Solve:
Outline
1. Procedure to add two base-r numbers
2. Procedure to subtract two base-r numbers
3. Multiplication of two base-r numbers
Example:
Binary Multiplication

Example :
Complements

• 1’s Complement (Diminished Radix Complement)

All ‘0’s become ‘1’s


All ‘1’s become ‘0’s
Example (10110000)2
(01001111)2

• If you add a number and its 1’s complement … 10110000


+ 01001111

11111111
Complements
2’s Complement (Radix Complement)
Take 1’s complement then add 1

OR Toggle all bits to the left of the first ‘1’ from the right( least significant 1)
Binary Subtraction Using 1’s Complements

The subtraction of two n bit unsigned binary numbers X –Y using the 1’s complement can
be done as follows:

• Take the 1’s complement of the subtrahend Y and add it to the minuend X.

 If X >= Y, the sum will produce and end carry at position 2n, which is added to LSB of
the sum. This operation is called end a round carry.
 If X < Y, the sum does not produce an end carry. To obtain the answer in a familiar
form, take the 1’s complement of the sum and place a negative sign in front.
Binary Subtraction Using 1’s Complement

Example:
Binary Subtraction Using 1’s Complement

Example :
Given the two binary numbers X = 1101 and Y = 10, perform the subtraction X – Y by
using 1's complement.

1101 – 10 = 1011
Binary Subtraction Using 1’s Complement
perform the subtraction by using 1’s complements

There is no end carry. Therefore, the


answer is Y - X = -(1’s complement of
1101110) = -0010001.
Binary Subtraction Using 2’s Complement

The subtraction of two n bit unsigned binary numbers


X – Y using 2’s complement can be done as follows:

• Take the 2’s complement of the subtrahend Y and add it to the minuend X.
• If X >= Y, the sum will produce and end carry at position 2n, which can be
discarded; what is left is the result X – Y.
• If X < Y, the sum does not produce an end carry. To obtain the answer in a familiar
form, take the 2’s complement of the sum and place a negative sign in front.
Binary Subtraction Using 2’s Complement

Example
Given the two binary numbers X = 1010100 and Y = 1000011, perform the
subtraction (a) X – Y ; and (b) Y  X, by using 2's complement.
Examples :

Q 1. Given the two binary numbers X = 1001 and Y = 0101, perform the

subtraction X – Y by using 2's complement.

A. 1001 – 0101 = 0100

Q 2. Given the two binary numbers X = 1010010 and Y = 11100100, perform the

subtraction X – Y by using 2's complement.

A. 1010010 – 11100100 = - 10010010


Solve:

◆ Given the two binary numbers X = 1010100 and Y = 1000011,

perform the subtraction

(a) X – Y

(b) Y-X, by using 2's complement.


Registers

Registers are fast storage devices used inside processors Used to store computation
results of a running program
A Register consists of a fixed number of storage bits

The register size n is typically a power of 2 (8, 16, 32, 64)


Numbers stored in registers are either unsigned or signed
The byte size is equal to 8 bits, but the word size can vary from one computer to
another.
Signed Binary Numbers
• Plus and minus signs are used for decimal numbers: 20 (or +20), −15, etc
• Computers Represent Information in ‘0’s and ‘1’s
‘+’ and ‘−’ signs have to be represented in ‘0’s and ‘1’s
• 3 different ways to represent negative number (e.g. -9)
Signed- Magnitude representation: 10001001
Signed-1’s Complement representation: 11110110

Signed-2’s Complement representation: 11110111 All three use the left most bit to represent the sign:
» ‘0’  positive
» ‘1’  negative

• Example the different representations of -9


using 8 bit number:
Signed Binary Numbers
• Table 1.3 lists all possible four-bit signed binary numbers in the three
representations.
Signed Magnitude Representation

Magnitude is magnitude, does not change with sign


Signed-1’s Complement Representation

Positive numbers are represented in “Binary”


Magnitude (Binary)
Negative numbers are represented in “1’s Complement”
Code (1’s Complement)
(+3)10  (0 011)2
(−3)10  (1 100)2

There are 2 representations for ‘0’


(+0)10  (0 000)2
(−0)10  (1 111)2
Signed-1’s Complement Range
Signed-2’s Complement Representation

Positive numbers are represented in “Binary”


Magnitude (Binary)
Negative numbers are represented in “2’s Complement”
Code (2’s Complement)
(+3)10  (0 011)2
(−3)10  (1 101)2
Signed-2’s Complement Range
Number Representations
Binary Codes
• Digital systems represent and manipulate not only binary numbers, but also many other
discrete elements of information.
• Any discrete element of information that is distinct among a groupof quantities can be
represented with a binary code (a pattern of 0’s and 1’s).
• The codes must be in binary because, in today’s technology, only circuits that represen
and manipulate patterns of 0’s and 1’s can be manufactured economically for use in
computers
• Binary code will have some unassigned bit combinations if the number o
elements in the set is not a multiple power of 2.
Binary Codes

• How to represent characters, colors, etc? Define the set of all represented
elements.
• Assign a unique binary code to each element of the set. Given n bits, a binary code is a

mapping from the set of elements to a subset of the 2n binary numbers.


• Coding Numeric Data (example: coding decimal digits)
◆Coding must simplify common arithmetic operations.
◆Tight relation to binary numbers.

• Coding Non-Numeric Data (example: coding colors)


◆More flexible codes since arithmetic operations are not applied.
◆Not tied to binary numbers.
Example of Coding Non-Numeric Data

Suppose we want to code 7 colors of the rainbow.

As a minimum, we need 3 bits to define 7 unique values. 3 bits define 8 possible combinations.

Each combination represents a color. Only 7 combinations are needed.

Code 111 is not used.


Color 3-bit code
Other assignments are also possible Red 000

Orange 001

Yellow 010

Green 011

Blue 100

Indigo 101

Violet 110
Decimal Codes

• Binary number system is most natural for computers. But people are used to the
decimal system.
• Must convert decimal numbers to binary, do arithmetic on binary numbers, then
convert back to decimal.
• To simplify conversions, decimal codes can be used. Define a binary code for each
decimal digit.
• Since 10 decimal digits exit, a 4-bit code is used. But a 4-bit code gives 16
unique combinations. 10 combinations are used and 6 will be unused.
Binary Coded Decimal

• Simplest binary code for decimal digits


• Each Decimal Digit is represented by 4 bits
• A number with N decimal digits will require 4 × N bits in BCD.

Example: Decimal 396 is represented in BCD with 12 bits as


0011 1001 0110
with each group of 4 bits representing one decimal digit.

• A decimal number in BCD is the same as its equivalent binary number only when the
number is between 0 and 9.

• The binary combinations 1010 through 1111 (10 – 15) are not used and have no meaning
in BCD (i.e. invalid combinations)
Warning: Conversion or Coding?

Do NOT mix up conversion of a decimal number to a binary number with coding a decimal
number with a binary code
Single Digit BCD Addition

We use binary arithmetic to add the BCD digits


If the result is 1 decimal digit ( ≤ 9 ), then it is a simple
binary addition
Example 1:
Single Digit BCD Addition

If the result is two decimal digits ( ≥ 10 ), then binary addition gives


invalid combinations

If the binary result is greater than 9,


correct the result by adding 6
Single Digit BCD Addition
Multiple Digit BCD Addition
Multiple Digit BCD Addition

Consider the addition of 184 + 576 = 760 in BCD:


Other binary Codes
Binary codes

Example :
Convert the decimal digit 5 from:
•BCD (8421)
BCD (8421) for 5 = 0101
•Excess-3
Excess-3 = BCD + 3 = 0101 + 0011 = 1000
•2421
2421 for 5 = 1011
• 8,4,-2,-1
8,4,-2,-1 for 5=1011
Other Decimal Codes
Excess-3 , 2421 and 8,4,-2,-1 are self-complementing codes
(i.e. the 9’s complement of the decimal number is obtained by changing 1’s
to 0’s and 0’s to 1’s.)

For example: 395 is represented in 2, 4, 2, 1 code by 001111111011. its 9’s


complement 604 is represented by 110000000100.

Note that the codes for 0 and 9, 1 and 8, etc. can be obtained from each other
by replacing the 0’s with the 1’s and vice-versa in the code words.

Note that BCD is NOT self-complementing


Other Decimal Codes

Note that, Excess-3 code assignment is obtained from the corresponding


value of BCD after the addition 3.

Example: The number (945)10= (1001 0100 0101)BCD is

represented in excess-3 as(1100 0111 1000)ex-3


Gray Code (The Reflected Code)
Used to represent the digital data converted from the analog data.
Only 1 bit changes from one decimal digit to the next.

Different than Binary.


Can be used in low-power logic circuits that count up or down,
because only 1 bit changes per count
Gray Code (The Reflected Code)

Example: (10011)2 = ( ? )Gray Code

Gray code : 11010

Example :(1011001)2 = ( ? )Gray Code

Gray code : 1110101


Gray Code (The Reflected Code)

Example : (11100)Gray Code = ( ? )2

Binary : 10111

Example :(101100)Gray Code= ( ? )2

Binary : 110111
ASCII Character Code

American Standard Code for Information Interchange (Pronounced ass-key)


• A popular code used to represent information sent as character-based
data.
• Standard ASCII: 7-bit character codes - 27 codes (0 – 127).
• Extended ASCII: 8-bit character codes- 28 codes (0 – 255). The 8th
bit is used for a parity bit.
Two general types of codes:
95 are “Graphic” codes (Printing characters- displayable on a console)
33 are “Control” codes (Non-printing characters)
Some non-printing characters are used for text format (e.g. BS = Backspace, CR = carriage
return).
Other non-printing characters are used for record marking and flow control (e.g. STX and
ETX start and end text areas).
ASCII Code
Control Characters
ASCII Properties

ASCII has some interesting properties:


◆Digits 0 to 9 span Hexadecimal values (30)16 to (39)16
◆Upper case A-Z span (41)16 to (5A)16
◆Lower case a-z span (61)16 to (7A)16
» Lower to upper case translation (and vice versa) occurs by flipping bit 6.
» Example: A =( 41)16 = (1000001)ASCII a = (61)16 = (1100001)ASCII
Unicode

Unicode: 16-bit character codes (0 – 65,535).


Unicode standard represents a universal character set
◆ Defines codes for characters used in all major languages.
◆ Used in Windows-XP: each character is encoded as 16 bits
Parity Bit & Error Detection Codes

Binary data are typically transmitted between computers.


Because of noise, a corrupted bit will change value.
To detect errors, extra bits are added to each data value.
Parity bit: is used to make the number of 1’s odd or even.
Even parity: number of 1’s in the transmitted data is even.
Odd parity: number of 1’s in the transmitted data is odd.
Example: Two characters and their even and odd parity
Detecting Errors

Suppose we are transmitting 7-bit ASCII characters


A parity bit is added to each character to make it 8 bits Parity can detect all single-bit
errors
• If even parity is used and a single bit changes, it will change the parity to odd, which
will be detected at the receiver end
• The receiver end can detect the error, but cannot correct it because it does not know
which bit is erroneous
Binary Storage and Registers

Registers:
◆A binary cell is a device that possesses two stable states and is capable of storing
one of the two states(i.e. Each cell stores one bit of information. Examples: flip-
flop, capacitor.
◆A register is a group of binary cells. Example: AX in x86 CPU.

A register with n cells can store any discrete quantity of information that contains

n bits.
Binary Logic

• Binary logic consists of binary variables and a set of logical operations.


• The variables are designated by letters of the alphabet, such as A , B, C, x, y, z,
etc, with each variable having two and only two distinct possible values: 1 & 0,
• Three basic logical operations: AND, OR, and NOT.
Binary Logic

 AND: This operation is represented by a dot or by the absence of an operator.


For example, x . y = z or xy = z is read “x AND y is equal to z.”
The logical operation AND is interpreted to mean that z = 1 if and only if x = 1 and y = 1;
otherwise z = 0.
 OR: This operation is represented by a plus sign.
For example, x + y = z is read “x OR y is equal to z,” meaning that
z = 1 if x = 1 or if y = 1 or if both x = 1 and y = 1.
If both x = 0 and y = 0, then z = 0.
 NOT: This operation is represented by a prime (sometimes by an overbar).
For example, (or ) is read “not x is equal to z,” meaning that z is what x is not.
In other words, if x = 1, then z = 0, but if x = 0, then z = 1.
The NOT operation is also referred to as the complement operation, since it
changes a 1 to 0 and a 0 to 1.
Binary Logic

Definitions of logical operations may be listed in a compact form called truth tables. A truth
table is a table of all possible combinations of the variables, showing the relation between
the values that the variables may take and the result of the operation
Logic gates
Logic gates are electronic circuits that operate on one or more input signals to produce
an output signal.
Logic gates

AND and OR gates may have more than two inputs.

You might also like