SlideShare una empresa de Scribd logo
1 de 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.

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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
 

Similar a 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
 

Similar a 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
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 

Último (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

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