SlideShare a Scribd company logo
1 of 17
Download to read offline
INSTITUTE OF AERONAUTICALENGINEERING
Department of Computer Science and Engineering
Submitted To: Submitted By:
CH SHRI HARI ASHISH KUMAR THAKUR
Seminar on Number
Code and Register
Overview
 2’s complement numbers
› Addition and subtraction
 Binary coded decimal
 Gray codes for binary numbers
 ASCII characters
 Moving towards hardware
› Storing data
› Processing data
2’s Complement
Subtraction
 Let’s compute (13)10 - (5)10.
› (13)10 = +(1101)2 = (01101)2
› (-5)10 = -(0101)2 = (11011)2
 Adding these two 5-bit codes…
 Discarding the carry bit, the sign bit is seen to
be zero, indicating a correct result.
 Numbers in hexadecimal
0 1 1 0 1
+ 1 1 0 1 1
--------------
1 0 1 0 0 0
carry
2’s Complement
Subtraction
 Let’s compute (5)10 – (12)10.
› (-12)10 = -(1100)2 = (10100)2
› (5)10 = +(0101)2 = (00101)2
 Adding these two 5-bit codes…
 Here, there is no carry bit and the sign bit is
1. This indicates a negative result, which is
what we expect. (11001)2 = -(7)10.
 Numbers in hexadecimal
0 0 1 0 1
+ 1 0 1 0 0
--------------
1 1 0 0 1
Binary Coded Decimal
 Binary coded decimal (BCD) represents each
decimal digit with four bits
› Ex. 0011 0010 1001 = 32910
 This is NOT the same as 0011001010012
 Why do this? Because people think in decimal.
Digit BCD
Code
Digit BCD
Code
0 0000 5 0101
1 0001 6 0110
2 0010 7 0111
3 0011 8 1000
4 0100 9 1001
3 2 9
Putting It All Together
° BCD not very efficient
° Used in early
computers (40s, 50s)
° Used to encode
numbers for seven-
segment displays.
° Easier to read?
Gray Code
 Gray code is not a number
system.
› It is an alternate way to represent
four bit data
 Only one bit changes from
one decimal digit to the
next
 Useful for reducing errors
in communication.
 Can be scaled to larger
numbers.
Digit Binary Gray
Code
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110
5 0101 0111
6 0110 0101
7 0111 0100
8 1000 1100
9 1001 1101
10 1010 1111
11 1011 1110
12 1100 1010
13 1101 1011
14 1110 1001
15 1111 1000
ASCII Code
 American Standard Code for Information
Interchange
 ASCII is a 7-bit code, frequently used with an 8th
bit for error detection (more about that in a bit).
Character ASCII (bin) ASCII (hex) Decimal Octal
A 1000001 41 65 101
B 1000010 42 66 102
C 1000011 43 67 103
…
Z
a
…
1
‘
ASCII Codes and Data Transmission
° ASCII Codes
° A – Z (26 codes), a – z (26 codes)
° 0-9 (10 codes), others (@#$%^&*….)
° Complete listing in Mano text
° Transmission susceptible to noise
° Typical transmission rates (1500 Kbps, 56.6 Kbps)
° How to keep data transmission accurate?
Parity Codes
 Parity codes are formed by concatenating a parity
bit, P to each code word of C.
 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.
Information BitsP
1 1 0 0 0 0 1 1

Added even parity bit
0 1 0 0 0 0 1 1

Added odd parity bit
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
Binary Data Storage
• Binary cells store individual bits of data
• Multiple cells form a register.
• Data in registers can indicate different values
• Hex (decimal)
• BCD
• ASCII
Binary Cell
0 0 1 0 1 0 1 1
Register Transfer
 Data can move from register to register.
 Digital logic used to process data
 We will learn to design this logic
Register A Register B
Register C
Digital Logic
Circuits
Transfer of
Information
 Data input at keyboard
 Shifted into place
 Stored in memory
NOTE: Data input in ASCII
Building a Computer
 We need processing
 We need storage
 We need communication
 You will learn to use and
design these
components.
Summary
 Although 2’s complement most important, other
number codes exist
 ASCII code used to represent characters
(including those on the keyboard)
 Registers store binary data
 Next time: Building logic circuits!
Number system

More Related Content

What's hot

Computers numbering systems
Computers   numbering systemsComputers   numbering systems
Computers numbering systemssld1950
 
Number system logic gates
Number system logic gatesNumber system logic gates
Number system logic gatesJaipal Dhobale
 
DLD Presentation By Team Reboot,Rafin Rayan,EUB
DLD Presentation By Team Reboot,Rafin Rayan,EUBDLD Presentation By Team Reboot,Rafin Rayan,EUB
DLD Presentation By Team Reboot,Rafin Rayan,EUBRafin Rayan
 
Chapter 01 Basic Principles of Digital Systems
Chapter 01 Basic Principles of Digital SystemsChapter 01 Basic Principles of Digital Systems
Chapter 01 Basic Principles of Digital SystemsSSE_AndyLi
 
Data representation moris mano ch 03
Data representation   moris mano ch  03Data representation   moris mano ch  03
Data representation moris mano ch 03thearticlenow
 
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsChapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsSSE_AndyLi
 
data representation
 data representation data representation
data representationHaroon_007
 
Understand data representation on CPU 1
Understand data representation on CPU 1Understand data representation on CPU 1
Understand data representation on CPU 1Brenda Debra
 
Data Representation
Data RepresentationData Representation
Data RepresentationRick Jamil
 
Data representation
 Data representation Data representation
Data representationAshraf Miraz
 
Octal to binary and octal to hexa decimal conversions
Octal to binary and octal to hexa decimal conversionsOctal to binary and octal to hexa decimal conversions
Octal to binary and octal to hexa decimal conversionsAfrasiyab Haider
 

What's hot (20)

Number system
Number systemNumber system
Number system
 
Computers numbering systems
Computers   numbering systemsComputers   numbering systems
Computers numbering systems
 
Number system logic gates
Number system logic gatesNumber system logic gates
Number system logic gates
 
Data representation
Data representationData representation
Data representation
 
DLD Presentation By Team Reboot,Rafin Rayan,EUB
DLD Presentation By Team Reboot,Rafin Rayan,EUBDLD Presentation By Team Reboot,Rafin Rayan,EUB
DLD Presentation By Team Reboot,Rafin Rayan,EUB
 
Digital 1 8
Digital 1 8Digital 1 8
Digital 1 8
 
Chapter 01 Basic Principles of Digital Systems
Chapter 01 Basic Principles of Digital SystemsChapter 01 Basic Principles of Digital Systems
Chapter 01 Basic Principles of Digital Systems
 
dld 01-introduction
dld 01-introductiondld 01-introduction
dld 01-introduction
 
Data representation moris mano ch 03
Data representation   moris mano ch  03Data representation   moris mano ch  03
Data representation moris mano ch 03
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
 
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic CircuitsChapter 07 Digital Alrithmetic and Arithmetic Circuits
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
 
data representation
 data representation data representation
data representation
 
Binary code
Binary codeBinary code
Binary code
 
Understand data representation on CPU 1
Understand data representation on CPU 1Understand data representation on CPU 1
Understand data representation on CPU 1
 
08. Numeral Systems
08. Numeral Systems08. Numeral Systems
08. Numeral Systems
 
Lec 02
Lec 02Lec 02
Lec 02
 
Data Representation
Data RepresentationData Representation
Data Representation
 
Data representation
 Data representation Data representation
Data representation
 
Octal to binary and octal to hexa decimal conversions
Octal to binary and octal to hexa decimal conversionsOctal to binary and octal to hexa decimal conversions
Octal to binary and octal to hexa decimal conversions
 
Logic Design
Logic DesignLogic Design
Logic Design
 

Similar to Number system (20)

3RD.pptx
3RD.pptx3RD.pptx
3RD.pptx
 
bits.ppt
bits.pptbits.ppt
bits.ppt
 
W 9 numbering system
W 9 numbering systemW 9 numbering system
W 9 numbering system
 
W 9 numbering system
W 9 numbering systemW 9 numbering system
W 9 numbering system
 
Number System.pdf
Number System.pdfNumber System.pdf
Number System.pdf
 
004 NUMBER SYSTEM (1).pdf
004 NUMBER SYSTEM (1).pdf004 NUMBER SYSTEM (1).pdf
004 NUMBER SYSTEM (1).pdf
 
Codes r005
Codes  r005Codes  r005
Codes r005
 
Digital electronics
Digital electronicsDigital electronics
Digital electronics
 
Computer archi&mp
Computer archi&mpComputer archi&mp
Computer archi&mp
 
Lecture_2.pptx
Lecture_2.pptxLecture_2.pptx
Lecture_2.pptx
 
digitalelectronics.ppt
digitalelectronics.pptdigitalelectronics.ppt
digitalelectronics.ppt
 
Number Systems
Number  SystemsNumber  Systems
Number Systems
 
COMPUTER AWARENESS.pptx
COMPUTER AWARENESS.pptxCOMPUTER AWARENESS.pptx
COMPUTER AWARENESS.pptx
 
DLD-Introduction.pptx
DLD-Introduction.pptxDLD-Introduction.pptx
DLD-Introduction.pptx
 
Numbering Systems
Numbering SystemsNumbering Systems
Numbering Systems
 
1.1.1 BINARY SYSTEM
1.1.1 BINARY SYSTEM1.1.1 BINARY SYSTEM
1.1.1 BINARY SYSTEM
 
Class2
Class2Class2
Class2
 
21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx
 
Computer organiztion2
Computer organiztion2Computer organiztion2
Computer organiztion2
 
Lecture6 Chapter1- ASCII Code, Error Detection and Correction Codes, and Bina...
Lecture6 Chapter1- ASCII Code, Error Detection and Correction Codes, and Bina...Lecture6 Chapter1- ASCII Code, Error Detection and Correction Codes, and Bina...
Lecture6 Chapter1- ASCII Code, Error Detection and Correction Codes, and Bina...
 

More from Ashish Kumar Thakur

More from Ashish Kumar Thakur (12)

No sql databases
No sql databasesNo sql databases
No sql databases
 
Home automation using bluetooth - Aurdino BASED
Home automation using bluetooth - Aurdino BASEDHome automation using bluetooth - Aurdino BASED
Home automation using bluetooth - Aurdino BASED
 
APRIORI Algorithm
APRIORI AlgorithmAPRIORI Algorithm
APRIORI Algorithm
 
Traveling salesman problem
Traveling salesman problemTraveling salesman problem
Traveling salesman problem
 
Cse image processing ppt
Cse image processing pptCse image processing ppt
Cse image processing ppt
 
A survey on artificial neural networks in cyber world
A survey on artificial neural networks in cyber world A survey on artificial neural networks in cyber world
A survey on artificial neural networks in cyber world
 
An event driven campus navigation system on andriod121
An event driven campus navigation system on andriod121An event driven campus navigation system on andriod121
An event driven campus navigation system on andriod121
 
Ram ppt
Ram pptRam ppt
Ram ppt
 
Data warehousing ppt
Data warehousing pptData warehousing ppt
Data warehousing ppt
 
Objec oriented Analysis and design Pattern
Objec oriented Analysis and design PatternObjec oriented Analysis and design Pattern
Objec oriented Analysis and design Pattern
 
Dwd mdatamining intro-iep
Dwd mdatamining intro-iepDwd mdatamining intro-iep
Dwd mdatamining intro-iep
 
Biomass conversion technologies
Biomass conversion technologiesBiomass conversion technologies
Biomass conversion technologies
 

Recently uploaded

HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Recently uploaded (20)

🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 

Number system

  • 1. INSTITUTE OF AERONAUTICALENGINEERING Department of Computer Science and Engineering Submitted To: Submitted By: CH SHRI HARI ASHISH KUMAR THAKUR Seminar on Number Code and Register
  • 2. Overview  2’s complement numbers › Addition and subtraction  Binary coded decimal  Gray codes for binary numbers  ASCII characters  Moving towards hardware › Storing data › Processing data
  • 3. 2’s Complement Subtraction  Let’s compute (13)10 - (5)10. › (13)10 = +(1101)2 = (01101)2 › (-5)10 = -(0101)2 = (11011)2  Adding these two 5-bit codes…  Discarding the carry bit, the sign bit is seen to be zero, indicating a correct result.  Numbers in hexadecimal 0 1 1 0 1 + 1 1 0 1 1 -------------- 1 0 1 0 0 0 carry
  • 4. 2’s Complement Subtraction  Let’s compute (5)10 – (12)10. › (-12)10 = -(1100)2 = (10100)2 › (5)10 = +(0101)2 = (00101)2  Adding these two 5-bit codes…  Here, there is no carry bit and the sign bit is 1. This indicates a negative result, which is what we expect. (11001)2 = -(7)10.  Numbers in hexadecimal 0 0 1 0 1 + 1 0 1 0 0 -------------- 1 1 0 0 1
  • 5. Binary Coded Decimal  Binary coded decimal (BCD) represents each decimal digit with four bits › Ex. 0011 0010 1001 = 32910  This is NOT the same as 0011001010012  Why do this? Because people think in decimal. Digit BCD Code Digit BCD Code 0 0000 5 0101 1 0001 6 0110 2 0010 7 0111 3 0011 8 1000 4 0100 9 1001 3 2 9
  • 6. Putting It All Together ° BCD not very efficient ° Used in early computers (40s, 50s) ° Used to encode numbers for seven- segment displays. ° Easier to read?
  • 7. Gray Code  Gray code is not a number system. › It is an alternate way to represent four bit data  Only one bit changes from one decimal digit to the next  Useful for reducing errors in communication.  Can be scaled to larger numbers. Digit Binary Gray Code 0 0000 0000 1 0001 0001 2 0010 0011 3 0011 0010 4 0100 0110 5 0101 0111 6 0110 0101 7 0111 0100 8 1000 1100 9 1001 1101 10 1010 1111 11 1011 1110 12 1100 1010 13 1101 1011 14 1110 1001 15 1111 1000
  • 8. ASCII Code  American Standard Code for Information Interchange  ASCII is a 7-bit code, frequently used with an 8th bit for error detection (more about that in a bit). Character ASCII (bin) ASCII (hex) Decimal Octal A 1000001 41 65 101 B 1000010 42 66 102 C 1000011 43 67 103 … Z a … 1 ‘
  • 9. ASCII Codes and Data Transmission ° ASCII Codes ° A – Z (26 codes), a – z (26 codes) ° 0-9 (10 codes), others (@#$%^&*….) ° Complete listing in Mano text ° Transmission susceptible to noise ° Typical transmission rates (1500 Kbps, 56.6 Kbps) ° How to keep data transmission accurate?
  • 10. Parity Codes  Parity codes are formed by concatenating a parity bit, P to each code word of C.  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. Information BitsP 1 1 0 0 0 0 1 1  Added even parity bit 0 1 0 0 0 0 1 1  Added odd parity bit
  • 11. 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
  • 12. Binary Data Storage • Binary cells store individual bits of data • Multiple cells form a register. • Data in registers can indicate different values • Hex (decimal) • BCD • ASCII Binary Cell 0 0 1 0 1 0 1 1
  • 13. Register Transfer  Data can move from register to register.  Digital logic used to process data  We will learn to design this logic Register A Register B Register C Digital Logic Circuits
  • 14. Transfer of Information  Data input at keyboard  Shifted into place  Stored in memory NOTE: Data input in ASCII
  • 15. Building a Computer  We need processing  We need storage  We need communication  You will learn to use and design these components.
  • 16. Summary  Although 2’s complement most important, other number codes exist  ASCII code used to represent characters (including those on the keyboard)  Registers store binary data  Next time: Building logic circuits!