SlideShare a Scribd company logo
1 of 23
Download to read offline
Chapter1: Digital Systems and Binary
Numbers
Lecture6- Study ASCII Code, Error Detection and Correction
Codes, and Binary Logic
Engr. Arshad Nazir, Asst Prof
Dept of Electrical Engineering
SEECS 1
Fall 2022
Objectives
• Study ASCII Code
• Error Detection and Correction Codes
• Binary Logic
2
Fall 2022
ASCII Character Code
• The American Standard Code for Information Interchange (ASCII) uses seven
bits to code 128 characters.
• The ASCII code contains 94 graphic characters that are printable and 34
nonprinting characters used for various control functions. The graphic
characters consist of the 26 uppercase letters (A through Z), the 26 lowercase
letters (a through z), the 10 numerals (0 through 9), and 32 special characters,
such as %, *, and $.
• The 34 control characters are designated in the ASCII table with abbreviated
names. They are listed again in the table with their function names. The
control characters are used for routing data and arranging the printed text into
a prescribed format.
 The following ASCII chart allows you to specify the characters in decimal
representation by concatenating the column headings to the row headings.
For example, the character 5 is represented in binary as 0110101
Fall 2022 3
ASCII Table
Fall 2022 4
ASCII Table (Cont …
Fall 2022 5
Error-Detecting Code
• Error-Detecting uses an eighth bit (added to 7-bit ASCII character) to indicate parity.
 A parity bit is an extra bit that is set to 0 or 1 as needed to make the total
number of 1’s either even or odd.
 In an odd-parity code, the parity bit is specified so that the total number of ones
is odd.
 In an even-parity code, the parity bit is specified so that the total number of
ones is even.
 It detects one, three or any odd combination of errors but even combination of
errors is undetected.
Information Bits
P
1 1 0 0 0 0 1 1

Added even parity bit
0 1 0 0 0 0 1 1

Added odd parity bit
Fall 2022 6
Parity Code Example
• Concatenate a parity bit to the ASCII code for the characters 0, X, and
= to produce both odd-parity and even-parity codes.
Character ASCII Odd-Parity
ASCII
Even-Parity
ASCII
0 0110000 10110000 00110000
X 1011000 01011000 11011000
= 0111100 10111100 00111100
Fall 2022 7
Your Turn
• Express your complete registration number in ASCII code using:
 Even parity
 Odd parity
 MSB set as zero.
Fall 2022 8
Binary Storage
• Binary storage represents the storage mechanisms for binary data
stored in a computer.
 A binary cell is a device that possesses two stable states, and it
can store a single state value (0 or 1). It stores single bit of data.
examples: flip-flop circuits, ferrite cores, capacitor
 A register is a group of binary cells. n cells allows the register to
store n bits and thus 2n possible states.
o The type of information (BCD, ASCII, etc.) stored in a register
has to be agreed upon by the users of the register.
Binary Cell
0 0 1 0 1 0 1 1
Fall 2022 9
Register Transfer
• A register transfer operation involves the transfer of binary
information from one set of binary registers into other set of binary
registers.
• The capture and storage of information requires:
 An input register to store the key inputs from the keyboard
 A processor register to store the data when processed by the CPU
 A memory register in the memory unit to store the values
Fall 2022 10
Register Transfer
• Data input at keyboard
• Shifted into place
• Stored in memory
 NOTE: Data input in ASCII
Fall 2022 11
Binary Information Processing
• The actual processing of binary information in a computer is
completed by digital logic circuits which have been implemented to
serve a specific purpose (i.e. addition).
 The registers are accessed (read and write) when they are
needed to complete an operation. For example we need two
register sets to store two values to be added and a register set to
store the result of the sum.
o Furthermore, we need three registers in both the memory
unit and in the processor.
Fall 2022 12
Example Binary Information
Processing
• We need processing
• We need storage
• We need communication
Fall 2022 13
Binary Logic
• Binary logic consists of binary variables and logical operations.
 The variables are designated by letters of the alphabet (A, B, C, x,
y, z, etc.).
 There are three basic logical operations:
o AND
o OR
o NOT
Fall 2022 14
Logical Operations
• AND is represented by a dot or the absence of an operator.
 x·y = z or xy = z
 Read as “x and y is equal to z”
 Means that z=1 if and only if x=1 and y=1
• OR is represented by a plus sign.
 x+y = z
 Read as “x or y is equal to z”
 Means that z=1 if x=1 or y=1 or both x=1 and y=1
• NOT is represented by a prime or an over bar.
 x´=z or x = z
 Read as “not x is equal to z”
 Means that if x=1 then z=0 or if x=0 then z=1
Fall 2022 15
Truth Tables
• Since each binary variable consists of value of 0 or 1, each
combination of values for the variables involved in a binary operation
has a specific result value.
• A truth table is a method of visualizing all possible combinations of
the input values and the respective output values that occur due to
the operation on the specified combination.
AND
A B A.B
0 0 0
0 1 0
1 0 0
1 1 1
OR
A B A+B
0 0 0
0 1 1
1 0 1
1 1 1
NOT
A A′
0 1
1 0
Fall 2022 16
Logic Gates
• Logic gates are electronic circuits that operate on one or more input
signals to produce an output signal.
 The state (high-low, on-off) of electricity on a line represents each of
the two states for binary representation (1 or 0).
• Logic Gate Symbols
Fall 2022 17
AND Logic Function
• Using door
 Both doors are
opened to pass the
light
• Using Switches
Switches are input
and LED is output
Both witches closed
(ON) to give output
Fall 2022 18
OR Logic Function
• Using door
 Any one or both doors are
opened to pass the light
• Using Switches
Switches are input and
LED is output
Any one switch or both
closed to give output
Fall 2022 19
Fall 2022 20
Timing Diagram
Fall 2022 21
Multi-Input Circuits
Fall 2022 22
The End
23
Fall 2022

More Related Content

Similar to Lecture6 Chapter1- ASCII Code, Error Detection and Correction Codes, and Binary Logic.pdf

B sc cs i bo-de u-iii combitional logic circuit
B sc cs i bo-de u-iii combitional logic circuitB sc cs i bo-de u-iii combitional logic circuit
B sc cs i bo-de u-iii combitional logic circuitRai University
 
Introduction to computer_lec_02_fall_2018
Introduction to computer_lec_02_fall_2018Introduction to computer_lec_02_fall_2018
Introduction to computer_lec_02_fall_2018Ramadan Babers, PhD
 
Digital logic degin, Number system
Digital logic degin, Number systemDigital logic degin, Number system
Digital logic degin, Number systemAshish Kumar Thakur
 
B.sc cs-ii-u-1.4 digital logic circuits, digital component
B.sc cs-ii-u-1.4 digital logic circuits, digital componentB.sc cs-ii-u-1.4 digital logic circuits, digital component
B.sc cs-ii-u-1.4 digital logic circuits, digital componentRai University
 
data representation
 data representation data representation
data representationHaroon_007
 
Bca 2nd sem-u-1.4 digital logic circuits, digital component
Bca 2nd sem-u-1.4 digital logic circuits, digital componentBca 2nd sem-u-1.4 digital logic circuits, digital component
Bca 2nd sem-u-1.4 digital logic circuits, digital componentRai University
 
Decoders
DecodersDecoders
DecodersRe Man
 
Dd 160506122947-160630175555-160701121726
Dd 160506122947-160630175555-160701121726Dd 160506122947-160630175555-160701121726
Dd 160506122947-160630175555-160701121726marangburu42
 
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptx
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptxDLD Lecture No 18 Analysis and Design of Combinational Circuit.pptx
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptxSaveraAyub2
 

Similar to Lecture6 Chapter1- ASCII Code, Error Detection and Correction Codes, and Binary Logic.pdf (20)

Coa presentation1
Coa presentation1Coa presentation1
Coa presentation1
 
Chapter-04.pdf
Chapter-04.pdfChapter-04.pdf
Chapter-04.pdf
 
B sc cs i bo-de u-iii combitional logic circuit
B sc cs i bo-de u-iii combitional logic circuitB sc cs i bo-de u-iii combitional logic circuit
B sc cs i bo-de u-iii combitional logic circuit
 
Introduction to computer_lec_02
Introduction to computer_lec_02Introduction to computer_lec_02
Introduction to computer_lec_02
 
Combinational Circuits PPT.pdf
Combinational Circuits PPT.pdfCombinational Circuits PPT.pdf
Combinational Circuits PPT.pdf
 
Combinational circuits
Combinational circuitsCombinational circuits
Combinational circuits
 
STLD-Combinational logic design
STLD-Combinational  logic design STLD-Combinational  logic design
STLD-Combinational logic design
 
Introduction to computer_lec_02_fall_2018
Introduction to computer_lec_02_fall_2018Introduction to computer_lec_02_fall_2018
Introduction to computer_lec_02_fall_2018
 
Digital logic degin, Number system
Digital logic degin, Number systemDigital logic degin, Number system
Digital logic degin, Number system
 
B.sc cs-ii-u-1.4 digital logic circuits, digital component
B.sc cs-ii-u-1.4 digital logic circuits, digital componentB.sc cs-ii-u-1.4 digital logic circuits, digital component
B.sc cs-ii-u-1.4 digital logic circuits, digital component
 
2dig circ
2dig circ2dig circ
2dig circ
 
Digital Logic Design
Digital Logic Design Digital Logic Design
Digital Logic Design
 
data representation
 data representation data representation
data representation
 
Bca 2nd sem-u-1.4 digital logic circuits, digital component
Bca 2nd sem-u-1.4 digital logic circuits, digital componentBca 2nd sem-u-1.4 digital logic circuits, digital component
Bca 2nd sem-u-1.4 digital logic circuits, digital component
 
Decoders
DecodersDecoders
Decoders
 
DCF-Combinational circuit
DCF-Combinational circuitDCF-Combinational circuit
DCF-Combinational circuit
 
Dd 160506122947-160630175555-160701121726
Dd 160506122947-160630175555-160701121726Dd 160506122947-160630175555-160701121726
Dd 160506122947-160630175555-160701121726
 
lecture_19.pptx
lecture_19.pptxlecture_19.pptx
lecture_19.pptx
 
COA pptx.pptx
COA pptx.pptxCOA pptx.pptx
COA pptx.pptx
 
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptx
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptxDLD Lecture No 18 Analysis and Design of Combinational Circuit.pptx
DLD Lecture No 18 Analysis and Design of Combinational Circuit.pptx
 

More from UmerKhan147799

Lecture5 Chapter1- Binary Codes.pdf
Lecture5 Chapter1- Binary Codes.pdfLecture5 Chapter1- Binary Codes.pdf
Lecture5 Chapter1- Binary Codes.pdfUmerKhan147799
 
Lecture6 Chapter3- Function Simplification using Quine-MacCluskey Method.pdf
Lecture6 Chapter3- Function Simplification using Quine-MacCluskey Method.pdfLecture6 Chapter3- Function Simplification using Quine-MacCluskey Method.pdf
Lecture6 Chapter3- Function Simplification using Quine-MacCluskey Method.pdfUmerKhan147799
 
Lecture4 Chapter4- Design 4-bit Lookahead Carry Binary Adder-Subtractor Circu...
Lecture4 Chapter4- Design 4-bit Lookahead Carry Binary Adder-Subtractor Circu...Lecture4 Chapter4- Design 4-bit Lookahead Carry Binary Adder-Subtractor Circu...
Lecture4 Chapter4- Design 4-bit Lookahead Carry Binary Adder-Subtractor Circu...UmerKhan147799
 
Lecture5 Chapter2- Positive and Negative Logic.pdf
Lecture5 Chapter2- Positive and Negative Logic.pdfLecture5 Chapter2- Positive and Negative Logic.pdf
Lecture5 Chapter2- Positive and Negative Logic.pdfUmerKhan147799
 
Lecture4 Chapter3- Non-Degenerate Forms.pdf
Lecture4 Chapter3- Non-Degenerate Forms.pdfLecture4 Chapter3- Non-Degenerate Forms.pdf
Lecture4 Chapter3- Non-Degenerate Forms.pdfUmerKhan147799
 
Lecture5 Chapter4- Design Decimal Adder and Binary Multiplier Circuits.pdf
Lecture5 Chapter4- Design Decimal Adder and Binary Multiplier Circuits.pdfLecture5 Chapter4- Design Decimal Adder and Binary Multiplier Circuits.pdf
Lecture5 Chapter4- Design Decimal Adder and Binary Multiplier Circuits.pdfUmerKhan147799
 
Lecture5 Chapter3- Exclusive-OR Function and its Applications in Digital Desi...
Lecture5 Chapter3- Exclusive-OR Function and its Applications in Digital Desi...Lecture5 Chapter3- Exclusive-OR Function and its Applications in Digital Desi...
Lecture5 Chapter3- Exclusive-OR Function and its Applications in Digital Desi...UmerKhan147799
 

More from UmerKhan147799 (7)

Lecture5 Chapter1- Binary Codes.pdf
Lecture5 Chapter1- Binary Codes.pdfLecture5 Chapter1- Binary Codes.pdf
Lecture5 Chapter1- Binary Codes.pdf
 
Lecture6 Chapter3- Function Simplification using Quine-MacCluskey Method.pdf
Lecture6 Chapter3- Function Simplification using Quine-MacCluskey Method.pdfLecture6 Chapter3- Function Simplification using Quine-MacCluskey Method.pdf
Lecture6 Chapter3- Function Simplification using Quine-MacCluskey Method.pdf
 
Lecture4 Chapter4- Design 4-bit Lookahead Carry Binary Adder-Subtractor Circu...
Lecture4 Chapter4- Design 4-bit Lookahead Carry Binary Adder-Subtractor Circu...Lecture4 Chapter4- Design 4-bit Lookahead Carry Binary Adder-Subtractor Circu...
Lecture4 Chapter4- Design 4-bit Lookahead Carry Binary Adder-Subtractor Circu...
 
Lecture5 Chapter2- Positive and Negative Logic.pdf
Lecture5 Chapter2- Positive and Negative Logic.pdfLecture5 Chapter2- Positive and Negative Logic.pdf
Lecture5 Chapter2- Positive and Negative Logic.pdf
 
Lecture4 Chapter3- Non-Degenerate Forms.pdf
Lecture4 Chapter3- Non-Degenerate Forms.pdfLecture4 Chapter3- Non-Degenerate Forms.pdf
Lecture4 Chapter3- Non-Degenerate Forms.pdf
 
Lecture5 Chapter4- Design Decimal Adder and Binary Multiplier Circuits.pdf
Lecture5 Chapter4- Design Decimal Adder and Binary Multiplier Circuits.pdfLecture5 Chapter4- Design Decimal Adder and Binary Multiplier Circuits.pdf
Lecture5 Chapter4- Design Decimal Adder and Binary Multiplier Circuits.pdf
 
Lecture5 Chapter3- Exclusive-OR Function and its Applications in Digital Desi...
Lecture5 Chapter3- Exclusive-OR Function and its Applications in Digital Desi...Lecture5 Chapter3- Exclusive-OR Function and its Applications in Digital Desi...
Lecture5 Chapter3- Exclusive-OR Function and its Applications in Digital Desi...
 

Recently uploaded

Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating SystemRashmi Bhat
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptNarmatha D
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxVelmuruganTECE
 
Crushers to screens in aggregate production
Crushers to screens in aggregate productionCrushers to screens in aggregate production
Crushers to screens in aggregate productionChinnuNinan
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - GuideGOPINATHS437943
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdfHafizMudaserAhmad
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communicationpanditadesh123
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingBootNeck1
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...Erbil Polytechnic University
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 

Recently uploaded (20)

Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.ppt
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptx
 
Crushers to screens in aggregate production
Crushers to screens in aggregate productionCrushers to screens in aggregate production
Crushers to screens in aggregate production
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - Guide
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communication
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event Scheduling
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
"Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ..."Exploring the Essential Functions and Design Considerations of Spillways in ...
"Exploring the Essential Functions and Design Considerations of Spillways in ...
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 

Lecture6 Chapter1- ASCII Code, Error Detection and Correction Codes, and Binary Logic.pdf

  • 1. Chapter1: Digital Systems and Binary Numbers Lecture6- Study ASCII Code, Error Detection and Correction Codes, and Binary Logic Engr. Arshad Nazir, Asst Prof Dept of Electrical Engineering SEECS 1 Fall 2022
  • 2. Objectives • Study ASCII Code • Error Detection and Correction Codes • Binary Logic 2 Fall 2022
  • 3. ASCII Character Code • The American Standard Code for Information Interchange (ASCII) uses seven bits to code 128 characters. • The ASCII code contains 94 graphic characters that are printable and 34 nonprinting characters used for various control functions. The graphic characters consist of the 26 uppercase letters (A through Z), the 26 lowercase letters (a through z), the 10 numerals (0 through 9), and 32 special characters, such as %, *, and $. • The 34 control characters are designated in the ASCII table with abbreviated names. They are listed again in the table with their function names. The control characters are used for routing data and arranging the printed text into a prescribed format.  The following ASCII chart allows you to specify the characters in decimal representation by concatenating the column headings to the row headings. For example, the character 5 is represented in binary as 0110101 Fall 2022 3
  • 5. ASCII Table (Cont … Fall 2022 5
  • 6. Error-Detecting Code • Error-Detecting uses an eighth bit (added to 7-bit ASCII character) to indicate parity.  A parity bit is an extra bit that is set to 0 or 1 as needed to make the total number of 1’s either even or odd.  In an odd-parity code, the parity bit is specified so that the total number of ones is odd.  In an even-parity code, the parity bit is specified so that the total number of ones is even.  It detects one, three or any odd combination of errors but even combination of errors is undetected. Information Bits P 1 1 0 0 0 0 1 1  Added even parity bit 0 1 0 0 0 0 1 1  Added odd parity bit Fall 2022 6
  • 7. Parity Code Example • Concatenate a parity bit to the ASCII code for the characters 0, X, and = to produce both odd-parity and even-parity codes. Character ASCII Odd-Parity ASCII Even-Parity ASCII 0 0110000 10110000 00110000 X 1011000 01011000 11011000 = 0111100 10111100 00111100 Fall 2022 7
  • 8. Your Turn • Express your complete registration number in ASCII code using:  Even parity  Odd parity  MSB set as zero. Fall 2022 8
  • 9. Binary Storage • Binary storage represents the storage mechanisms for binary data stored in a computer.  A binary cell is a device that possesses two stable states, and it can store a single state value (0 or 1). It stores single bit of data. examples: flip-flop circuits, ferrite cores, capacitor  A register is a group of binary cells. n cells allows the register to store n bits and thus 2n possible states. o The type of information (BCD, ASCII, etc.) stored in a register has to be agreed upon by the users of the register. Binary Cell 0 0 1 0 1 0 1 1 Fall 2022 9
  • 10. Register Transfer • A register transfer operation involves the transfer of binary information from one set of binary registers into other set of binary registers. • The capture and storage of information requires:  An input register to store the key inputs from the keyboard  A processor register to store the data when processed by the CPU  A memory register in the memory unit to store the values Fall 2022 10
  • 11. Register Transfer • Data input at keyboard • Shifted into place • Stored in memory  NOTE: Data input in ASCII Fall 2022 11
  • 12. Binary Information Processing • The actual processing of binary information in a computer is completed by digital logic circuits which have been implemented to serve a specific purpose (i.e. addition).  The registers are accessed (read and write) when they are needed to complete an operation. For example we need two register sets to store two values to be added and a register set to store the result of the sum. o Furthermore, we need three registers in both the memory unit and in the processor. Fall 2022 12
  • 13. Example Binary Information Processing • We need processing • We need storage • We need communication Fall 2022 13
  • 14. Binary Logic • Binary logic consists of binary variables and logical operations.  The variables are designated by letters of the alphabet (A, B, C, x, y, z, etc.).  There are three basic logical operations: o AND o OR o NOT Fall 2022 14
  • 15. Logical Operations • AND is represented by a dot or the absence of an operator.  x·y = z or xy = z  Read as “x and y is equal to z”  Means that z=1 if and only if x=1 and y=1 • OR is represented by a plus sign.  x+y = z  Read as “x or y is equal to z”  Means that z=1 if x=1 or y=1 or both x=1 and y=1 • NOT is represented by a prime or an over bar.  x´=z or x = z  Read as “not x is equal to z”  Means that if x=1 then z=0 or if x=0 then z=1 Fall 2022 15
  • 16. Truth Tables • Since each binary variable consists of value of 0 or 1, each combination of values for the variables involved in a binary operation has a specific result value. • A truth table is a method of visualizing all possible combinations of the input values and the respective output values that occur due to the operation on the specified combination. AND A B A.B 0 0 0 0 1 0 1 0 0 1 1 1 OR A B A+B 0 0 0 0 1 1 1 0 1 1 1 1 NOT A A′ 0 1 1 0 Fall 2022 16
  • 17. Logic Gates • Logic gates are electronic circuits that operate on one or more input signals to produce an output signal.  The state (high-low, on-off) of electricity on a line represents each of the two states for binary representation (1 or 0). • Logic Gate Symbols Fall 2022 17
  • 18. AND Logic Function • Using door  Both doors are opened to pass the light • Using Switches Switches are input and LED is output Both witches closed (ON) to give output Fall 2022 18
  • 19. OR Logic Function • Using door  Any one or both doors are opened to pass the light • Using Switches Switches are input and LED is output Any one switch or both closed to give output Fall 2022 19