SlideShare une entreprise Scribd logo
1  sur  24
Data Representation
(in computer system)
Data Representation
    How do computers represent
     data?
a   Most computers are digital
    • Recognize only two discrete
      states: on or off
    • Computers are electronic
      devices powered by
      electricity, which has only
      two states, on or off
on    1       1       1       1       1




off
          0       0       0       0       0
Data Representation
What is the binary system?
a A number system that has just two unique
  digits, 0 and 1
  • A single digit is called a bit (binary digit)
  • A bit is the smallest unit of data the
    computer can represent
  • By itself a bit is not very informative
a The two digits represent the two off and
  on states
Binary Digit (bit)   Electronic   Electronic State
                      Charge
Data Representation
   What is a byte?
a Eight bits are grouped
  together to form a byte
a 0s and 1s in each byte are
  used to represent individual
  characters such as letters of
  the alphabet, numbers, and
  punctuation
8-bit byte for the number 3


8-bit byte for the number 5



8-bit byte for the capital letter T
Data Representation
What are two popular coding systems
to represent data?
a American   Standard Code for
 Information Interchange (ASCII)
a Extended Binary Coded Decimal
 Interchange Code (EBCDIC)
  • Sufficient for English and Western
    European languages
  • Unicode often used for others
Data Representation
How is a character sent from the
keyboard to the computer?
 Step 1:
 The user presses the letter T key on the keyboard
  Step 2:
  An electronic signal for the letter T is sent to the system unit

  Step 3:
  The signal for the letter T is converted to its ASCII binary code
  (01010100) and is stored in memory for processing
  Step 4:
  After processing, the binary code for the letter T is converted to an
  image on the output device
Decimal to Binary Conversions

•In an earlier slide, we said that every integer value can
be represented exactly using any radix system.
•You can use either of two methods for radix a
conversion: the subtraction method and the division
remainder method.
  The subtraction method is more intuitive, but
  cumbersome. It does, however reinforce the ideas
  behind radix mathematics.
  The division method employs the idea that
  successive division by a base is equivalent to
  successive subtraction by powers of the base.
Decimal to D
               Binary Conversions

•Fractional decimal values have nonzero digits
to the right of the decimal point.
•Fractional values of other radix systems have
nonzero digits to the right of the radix point.
•Numerals to the right of a radix point represent
negative powers of the radix:
         0.4710 = 4 × 10 -1 + 7 × 10 -2
         0.112 = 1 × 2 -1 + 1 × 2 -2
               = ½ + ¼
               = 0.5 + 0.25 = 0.75
Decimal to Binary Conversions

•As with whole-number conversions, you can
use either of two methods: a subtraction
method and an easy multiplication method.
•The subtraction method for fractions is
identical to the subtraction method for whole
numbers. Instead of subtracting positive powers
of the target radix, we subtract negative powers
of the radix.
•We always start with the largest value first, n -1,
where n is our radix, and work our way along
using larger negative exponents
Decimal to Binary Conversions
•HoweverThe binary numbering system is the
most important radix system for digital
computers.
•, it is difficult to read long strings of binary
numbers-- and even a modestly-sized decimal
number becomes a very long binary number.
  For example:   110101000110112 = 1359510
•For compactness and ease of reading, binary
values are usually expressed using the
hexadecimal, or base-16, numbering system.
Decimal to Binary Conversions

•The hexadecimal numbering system uses the
numerals 0 through 9 and the letters A through F.
    The decimal number 12 is C16.
    The decimal number 26 is 1A16.
•It is easy to convert between base 16 and base
2, because 16 = 24.
•Thus, to convert from binary to hexadecimal, all
we need to do is group the binary digits into
groups of four.
A group of four binary digits is called a hextet
Decimal to Binary Conversions
•Using groups of hextets, the binary number
110101000110112 (= 1359510) in hexadecimal is:



•Octal (base 8) values are derived from
binary by using groups of three bits (8 = 23):



Octal was very useful when computers used six-bit
words
Signed Integer Representation

•Several representations exist for negative values:
Sign Magnitude One's Complement Two's
Complement
   000 = +0          000 = +0                000 =    +0
   001 = +1          001 = +1                001 =    +1
   010 = +2          010 = +2                010 =    +2
   011 = +3          011 = +3                011 =    +3
   100 = -0          100 = -3                100 =    -4
   101 = -1          101 = -2                101 =    -3
   110 = -2          110 = -1                110 =    -2
   111 = -3          111 = -0                111 =    -1
Signed Integer Representation
•Given a full adder (FA), we can use it to
add binary digits (up to 3)




      A    B carry_in carry_out S
       0   0     0       0      0
       0   0     1       0      1
       0   1     0       0      1
       0   1     1       1      0
       1   0     0       0      1
       1   0     1       1      0
Signed Integer Representation

•    Several FA's can be used to add binary numbers
     by feeding out the carry_out one FA to the carry_in
     of the FA of the left.
                                                                                              add/sub

                    B31                    B2                  B1                  B0



                          A31                        A2                  A1                  A0


                    1-bit                  1-bit               1-bit               1-bit
              C32    FA         C31   C3    FA            C2    FA            C1    FA            C0

                      S31                       S2                  S1                  S0
    32-bit Ripple Carry Adder/Subtractor (Better: Carry Lookahead Adder)

      Note: add/sub is ON (1) if we want A-B, otherwise is OFF
•Booth’s algorithm
  -Multiplier and multiplicand are placed in
  registers Q & M
  -Q-1, 1-bit register placed to the right of Q0
     Initialize A (third register) and Q-1 to 0
     Do n times (n is the number of bits in Q):
        If Q0Q-1 = 01 then A <-- A + M
        If Q0Q-1 = 10 then A <-- A – M
        Arithmetic shift right A, Q, Q-1
Meghna ppt.
Meghna ppt.

Contenu connexe

Tendances

Data representation
 Data representation Data representation
Data representationAshraf Miraz
 
Data representation in computers
Data representation in computersData representation in computers
Data representation in computersHazel Anne Quirao
 
How computers represent data
How computers represent dataHow computers represent data
How computers represent dataShaon Ahmed
 
data representation
 data representation data representation
data representationHaroon_007
 
Binary, Decimal and Hexadecimal
Binary, Decimal and HexadecimalBinary, Decimal and Hexadecimal
Binary, Decimal and HexadecimalUthraSowrirajan1
 
Lec 02 data representation part 1
Lec 02 data representation part 1Lec 02 data representation part 1
Lec 02 data representation part 1Abdul Khan
 
Data representation
Data representationData representation
Data representationMysore
 
Data representation moris mano ch 03
Data representation   moris mano ch  03Data representation   moris mano ch  03
Data representation moris mano ch 03thearticlenow
 
Binary computing
Binary computingBinary computing
Binary computingsamina khan
 
2.1 data represent on cpu
2.1 data represent on cpu2.1 data represent on cpu
2.1 data represent on cpuWan Afirah
 

Tendances (19)

Data representation
 Data representation Data representation
Data representation
 
Data representation in computers
Data representation in computersData representation in computers
Data representation in computers
 
How computers represent data
How computers represent dataHow computers represent data
How computers represent data
 
Data representation in computers
Data representation in computersData representation in computers
Data representation in computers
 
Data representation
Data representationData representation
Data representation
 
Data Representation
Data RepresentationData Representation
Data Representation
 
data representation
 data representation data representation
data representation
 
Data representation
Data representationData representation
Data representation
 
Data representation
Data representationData representation
Data representation
 
Binary, Decimal and Hexadecimal
Binary, Decimal and HexadecimalBinary, Decimal and Hexadecimal
Binary, Decimal and Hexadecimal
 
Lec 02 data representation part 1
Lec 02 data representation part 1Lec 02 data representation part 1
Lec 02 data representation part 1
 
Data representation
Data representationData representation
Data representation
 
Data representation
Data representationData representation
Data representation
 
Data representation moris mano ch 03
Data representation   moris mano ch  03Data representation   moris mano ch  03
Data representation moris mano ch 03
 
Binary computing
Binary computingBinary computing
Binary computing
 
Data Representation
Data RepresentationData Representation
Data Representation
 
Chapter 1: Binary System
 Chapter 1: Binary System Chapter 1: Binary System
Chapter 1: Binary System
 
2.1 data represent on cpu
2.1 data represent on cpu2.1 data represent on cpu
2.1 data represent on cpu
 
Basics of digital electronics
Basics of digital electronicsBasics of digital electronics
Basics of digital electronics
 

Similaire à Meghna ppt.

Number system and codes
Number system and codesNumber system and codes
Number system and codesAbhiraj Bohra
 
Digital fundamendals r001a
Digital fundamendals r001aDigital fundamendals r001a
Digital fundamendals r001aarunachalamr16
 
Chapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfChapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfTamiratDejene1
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effectsPeriyanayagiS
 
Chapter 02 Data Types
Chapter 02   Data TypesChapter 02   Data Types
Chapter 02 Data TypesNathan Yeung
 
3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.pptRavikumarR77
 
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdfCDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdfshubhangisonawane6
 
Binary Codes and Number System
Binary Codes and Number SystemBinary Codes and Number System
Binary Codes and Number SystemDebarati Das
 
Unit-1 Digital Design and Binary Numbers:
Unit-1 Digital Design and Binary Numbers:Unit-1 Digital Design and Binary Numbers:
Unit-1 Digital Design and Binary Numbers:Asif Iqbal
 
Digital Electronics – Unit I.pdf
Digital Electronics – Unit I.pdfDigital Electronics – Unit I.pdf
Digital Electronics – Unit I.pdfKannan Kanagaraj
 

Similaire à Meghna ppt. (20)

Number system
Number systemNumber system
Number system
 
digitalelectronics.ppt
digitalelectronics.pptdigitalelectronics.ppt
digitalelectronics.ppt
 
Number system and codes
Number system and codesNumber system and codes
Number system and codes
 
Digital fundamendals r001a
Digital fundamendals r001aDigital fundamendals r001a
Digital fundamendals r001a
 
Alu1
Alu1Alu1
Alu1
 
Chapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfChapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdf
 
Digital Logic
Digital LogicDigital Logic
Digital Logic
 
Number_Systems (2).ppt
Number_Systems (2).pptNumber_Systems (2).ppt
Number_Systems (2).ppt
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effects
 
Chapter 02 Data Types
Chapter 02   Data TypesChapter 02   Data Types
Chapter 02 Data Types
 
3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt
 
Digital electronics
Digital electronicsDigital electronics
Digital electronics
 
Module 2_Data representations.pdf
Module 2_Data representations.pdfModule 2_Data representations.pdf
Module 2_Data representations.pdf
 
Okkkkk
OkkkkkOkkkkk
Okkkkk
 
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdfCDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
 
Binary Codes and Number System
Binary Codes and Number SystemBinary Codes and Number System
Binary Codes and Number System
 
Number Systems.ppt
Number Systems.pptNumber Systems.ppt
Number Systems.ppt
 
Counit2
Counit2Counit2
Counit2
 
Unit-1 Digital Design and Binary Numbers:
Unit-1 Digital Design and Binary Numbers:Unit-1 Digital Design and Binary Numbers:
Unit-1 Digital Design and Binary Numbers:
 
Digital Electronics – Unit I.pdf
Digital Electronics – Unit I.pdfDigital Electronics – Unit I.pdf
Digital Electronics – Unit I.pdf
 

Dernier

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Dernier (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

Meghna ppt.

  • 2. Data Representation How do computers represent data? a Most computers are digital • Recognize only two discrete states: on or off • Computers are electronic devices powered by electricity, which has only two states, on or off
  • 3. on 1 1 1 1 1 off 0 0 0 0 0
  • 4. Data Representation What is the binary system? a A number system that has just two unique digits, 0 and 1 • A single digit is called a bit (binary digit) • A bit is the smallest unit of data the computer can represent • By itself a bit is not very informative a The two digits represent the two off and on states
  • 5. Binary Digit (bit) Electronic Electronic State Charge
  • 6. Data Representation What is a byte? a Eight bits are grouped together to form a byte a 0s and 1s in each byte are used to represent individual characters such as letters of the alphabet, numbers, and punctuation
  • 7. 8-bit byte for the number 3 8-bit byte for the number 5 8-bit byte for the capital letter T
  • 8. Data Representation What are two popular coding systems to represent data? a American Standard Code for Information Interchange (ASCII) a Extended Binary Coded Decimal Interchange Code (EBCDIC) • Sufficient for English and Western European languages • Unicode often used for others
  • 9.
  • 10. Data Representation How is a character sent from the keyboard to the computer? Step 1: The user presses the letter T key on the keyboard Step 2: An electronic signal for the letter T is sent to the system unit Step 3: The signal for the letter T is converted to its ASCII binary code (01010100) and is stored in memory for processing Step 4: After processing, the binary code for the letter T is converted to an image on the output device
  • 11.
  • 12. Decimal to Binary Conversions •In an earlier slide, we said that every integer value can be represented exactly using any radix system. •You can use either of two methods for radix a conversion: the subtraction method and the division remainder method. The subtraction method is more intuitive, but cumbersome. It does, however reinforce the ideas behind radix mathematics. The division method employs the idea that successive division by a base is equivalent to successive subtraction by powers of the base.
  • 13. Decimal to D Binary Conversions •Fractional decimal values have nonzero digits to the right of the decimal point. •Fractional values of other radix systems have nonzero digits to the right of the radix point. •Numerals to the right of a radix point represent negative powers of the radix: 0.4710 = 4 × 10 -1 + 7 × 10 -2 0.112 = 1 × 2 -1 + 1 × 2 -2 = ½ + ¼ = 0.5 + 0.25 = 0.75
  • 14. Decimal to Binary Conversions •As with whole-number conversions, you can use either of two methods: a subtraction method and an easy multiplication method. •The subtraction method for fractions is identical to the subtraction method for whole numbers. Instead of subtracting positive powers of the target radix, we subtract negative powers of the radix. •We always start with the largest value first, n -1, where n is our radix, and work our way along using larger negative exponents
  • 15. Decimal to Binary Conversions •HoweverThe binary numbering system is the most important radix system for digital computers. •, it is difficult to read long strings of binary numbers-- and even a modestly-sized decimal number becomes a very long binary number. For example: 110101000110112 = 1359510 •For compactness and ease of reading, binary values are usually expressed using the hexadecimal, or base-16, numbering system.
  • 16. Decimal to Binary Conversions •The hexadecimal numbering system uses the numerals 0 through 9 and the letters A through F. The decimal number 12 is C16. The decimal number 26 is 1A16. •It is easy to convert between base 16 and base 2, because 16 = 24. •Thus, to convert from binary to hexadecimal, all we need to do is group the binary digits into groups of four. A group of four binary digits is called a hextet
  • 17. Decimal to Binary Conversions •Using groups of hextets, the binary number 110101000110112 (= 1359510) in hexadecimal is: •Octal (base 8) values are derived from binary by using groups of three bits (8 = 23): Octal was very useful when computers used six-bit words
  • 18. Signed Integer Representation •Several representations exist for negative values: Sign Magnitude One's Complement Two's Complement 000 = +0 000 = +0 000 = +0 001 = +1 001 = +1 001 = +1 010 = +2 010 = +2 010 = +2 011 = +3 011 = +3 011 = +3 100 = -0 100 = -3 100 = -4 101 = -1 101 = -2 101 = -3 110 = -2 110 = -1 110 = -2 111 = -3 111 = -0 111 = -1
  • 20. •Given a full adder (FA), we can use it to add binary digits (up to 3) A B carry_in carry_out S 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 0 1 1 0
  • 21. Signed Integer Representation • Several FA's can be used to add binary numbers by feeding out the carry_out one FA to the carry_in of the FA of the left. add/sub B31 B2 B1 B0 A31 A2 A1 A0 1-bit 1-bit 1-bit 1-bit C32 FA C31 C3 FA C2 FA C1 FA C0 S31 S2 S1 S0 32-bit Ripple Carry Adder/Subtractor (Better: Carry Lookahead Adder) Note: add/sub is ON (1) if we want A-B, otherwise is OFF
  • 22. •Booth’s algorithm -Multiplier and multiplicand are placed in registers Q & M -Q-1, 1-bit register placed to the right of Q0 Initialize A (third register) and Q-1 to 0 Do n times (n is the number of bits in Q): If Q0Q-1 = 01 then A <-- A + M If Q0Q-1 = 10 then A <-- A – M Arithmetic shift right A, Q, Q-1