2'4 Signed integer representation 2'6 Character codes - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

2'4 Signed integer representation 2'6 Character codes

Description:

Signed magnitude representation includes a sign as the first bit of the storage location. ... The American Standard Code for Information Interchange (ASCII) was ... – PowerPoint PPT presentation

Number of Views:57
Avg rating:3.0/5.0
Slides: 19
Provided by: Ngu799
Category:

less

Transcript and Presenter's Notes

Title: 2'4 Signed integer representation 2'6 Character codes


1
2.4 Signed integer representation2.6
Character codes
  • Nguyen Le
  • CS147

2
Section overview
  • 2.4 Signed Integer Representation
  • 2.4.1 Signed Magnitude
  • 2.4.2 Complement Systems
  • 2.4.3 Unsigned Versus Signed Numbers
  • 2.4.4 Computers, Arithmetic, and Booths
    Algorithm
  • 2.4.5 Carry Versus Overflow

3
Unsigned integer representation
  • 1 1 1 1 ? carries
  • 0 1 0 1 1 1 0 0
  • 0 1 1 0 1 0 1 1
  • 1 1 0 0 0 1 1 1

4
3 methods of representation
  • Signed magnitude
  • Ones complement
  • Twos complement

5
Signed magnitude
  • Signed magnitude representation includes a sign
    as the first bit of the storage location. A 1
    in the high-order bit (or left-most bit)
    indicates a negative number and the rest of the
    remaining bits represent the number itself.
  • Ex 1 and -1 in an 8-bit word would be
  • 0 0 0 0 0 0 0 1 (1)
  • 1 0 0 0 0 0 0 1 (-1)

6
Signed magnitude addition
  • 1 1 1 1 ? carries
  • 0 1 0 0 1 1 1 1
  • 0 0 1 0 0 0 1 1
  • 0 1 1 1 0 0 1 0

7
Overflow
  • Overflow in signed numbers occurs when the sign
    of the result is incorrect. The sign bit is used
    only for the sign, so we cant carry into it.
  • 1 1 1 1 1 ? carries
  • 0 1 0 0 1 1 1 1 (79)
  • 0 1 1 0 0 0 1 1 (99)
  • 0 0 1 1 0 0 1 0 (50)
  • 79 99 / 50

8
Signed magnitude subtraction
  • 0 1 1 2 ? borrows
  • 0 1 1 0 0 0 1 1 (99)
  • 0 1 0 0 1 1 1 1 (79)
  • 0 0 0 1 0 1 0 0 (20)
  • 99 79 20

9
Ones compliment
Flip the bits for all negative numbers. The last
carry is added to the sum.
  • 1 ? 1 1 1 1 1 ? carries
  • 0 0 0 1 0 1 1 1 (23)
  • 1 1 1 1 0 1 1 0 (-9)
  • 0 0 0 0 1 1 0 1
  • 1
  • 0 0 0 0 1 1 1 0 (14)

10
Twos compliment
Flip the bits for all negative numbers. Add 1.
23 00010111 -23 11101000 1 11101001
  • 0 0 0 0 1 0 0 1 (9)
  • 1 1 1 0 1 0 0 1 (-23)
  • 1 1 1 1 0 0 1 0 (-14)

11
Section overview
  • 2.6 Character Codes
  • 2.6.1 Binary-Coded Decimal
  • 2.6.2 EBCDIC
  • 2.6.3 ASCII
  • 2.6.4 Unicode

12
Character codes
  • Weve gone over how digital computers use the
    binary system to represent and manipulate numeric
    values, but have yet to consider how these
    internal values can be converted to a form that
    is meaningful to humans. This is done through a
    coding system used by the computer and how the
    values are stored and retrieved.

13
BCD
  • Binary Coded Decimal (BCD) is very common in
    electronics, particularly those that display
    numerical data, such as alarm clocks and
    calculators.
  • 4-bit binary form later extended to 6
  • 1265 0000 0001 0010 0110 0101 1101

14
EBCDIC
  • Extended Binary Coded Decimal Interchange Code
    (EBCDIC) used in IBM mainframe and midrange
    computer systems
  • 8-bit binary form
  • 1265 1111 0001 1111 0010 1111 0110 1101
    0101

15
(No Transcript)
16
ASCII
  • The American Standard Code for Information
    Interchange (ASCII) was created to better
    transmit data between systems.
  • Defines codes for 32 control characters, 10
    digits, 52 letters (upper and lower-case), 32
    special characters, and more.

17
(No Transcript)
18
Unicode
  • 16-bit base coding with the capacity to encode
    the majority of characters used in every language
    of the world.
  • Unicode also defines an extension mechanism that
    will allow for the coding of an additional
    million characters.
  • Default character set of the Java programming
    language.
Write a Comment
User Comments (0)
About PowerShow.com