Data Representation - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

Data Representation

Description:

Chapter 4 of Goodman and Millar - Data Representation. Goal. Describe the methods by which data can be represented and transmitted in a computer. ... – PowerPoint PPT presentation

Number of Views:99
Avg rating:3.0/5.0
Slides: 12
Provided by: mpea7
Category:

less

Transcript and Presenter's Notes

Title: Data Representation


1
Data Representation
  • Reading
  • Chapter 3 of Goodman and Millar - Number Systems
  • Chapter 4 of Goodman and Millar - Data
    Representation
  • Goal
  • Describe the methods by which data can be
    represented and transmitted in a computer.

2
Introduction
  • Inside a computer all data must be coded in a
    binary format
  • Coding format used will depend on the type of
    data
  • e.g. consider the number 9
  • 9 may be represented as 1001
  • -9 may be represented as 10111
  • 9.0 may be represented as 0000010010000001
  • the character 9 may be represented as 0111001

3
Introduction
  • When a coding format is being devised a number of
    considerations need to be made
  • Ease of manipulation
  • Conciseness and machine efficiency
  • Accuracy
  • Standardised data communication

4
Binary Data Representation
  • Some things that a computer may represent are
  • A machine instruction
  • A numeric quantity
  • A character
  • A graphic
  • A sound
  • Machine Instructions
  • Relationship between an instruction and its bit
    pattern is determined by the computer designer
    (e.g. the same bit pattern on the 68000 will have
    a different effect on an 8086)

5
Numbers
  • Need to represent ve and -ve numbers as well as
    very small and very large numbers
  • Number formats include BCD, signed magnitude,
    excess notation, two compliment, floating point.
  • Both decimal and Binary number systems are forms
    of positional number systems
  • e.g. 372910 3 x103 7 x 102 2 x 101 9 x
    100 101102 1 x 24 0 x 23 1 x 22 1 x 21
    0 x 20 2210

20
2-1
2-2
2-3
2-4
21
22
23
24
25
32
16
8
4
2
1
.
1/2
1/4
1/8
1/16
6
Numbers
  • representation of binary numbers pose problems
    for people
  • hard to read
  • easy to make errors
  • e.g. consider 1010011101011100
  • To minimise these errors use a different number
    system
  • Hexadecimal
  • Base 16
  • Uses the digit values 0, 1, 2, 3, 4, 5, 6, 7, 8,
    9, A, B, C, D, E, F
  • Each hex digit represents 4 binary digits
  • e.g. 10100111010111002 A75C
  • require 2 hex digits per byte

7
Numbers
  • Octal
  • Base 8
  • Uses the digit values 0, 1, 2, 3, 4, 5, 6, 7
  • e.g. 10100111010111002 1235348

8
Numeric Representation
  • BCD (binary coded decimal)
  • Each Decimal digit is coded as a 4 bit binary
    code
  • Developed for early calculators
  • e.g. 35910 0011 0101 1001bcd
  • Easy for people to understand, Hard for computers
    to work with
  • Signed Magnitude
  • Extra bit added to the code to represent the sign
  • In most cases
  • a 0 represents a ve
  • a 1 represents a ve

9
Excess Notation
  • fix number of bit positions used
  • smallest number with 1 in the MSB represents zero
    (e.g. 1000)
  • All bit strings greater than this represent ve
    numbers
  • All bit strings less than this represent -ve
    numbers
  • Example is known as excess eight notation because
    8 (100) represents zero

10
Twos Complement
  • Can represent numbers in the range -2n-1 to
    (2n-1-1)
  • One representation of zero
  • Can be sign extended
  • 510 00000101 0000000000000101
  • -510 11111011 1111111111111011

Binary
Negative
Compliment
Positive
0 1
1 0
1
Result
11
Twos Complement
0
-1
1
-2
0000
1111
1110
0001
-3
2
1101
0010
-4
3
0011
1100
-5
1011
4
0100
1010
0101
-6
5
1001
0110
6
-7
0111
1000
7
-8
Write a Comment
User Comments (0)
About PowerShow.com