CS 301 Fall 2002 Number Systems - PowerPoint PPT Presentation

About This Presentation
Title:

CS 301 Fall 2002 Number Systems

Description:

word = 2 bytes (16-bit) doubleword = 2 words (32-bit) quadword = 4 words (64-bit) ... One's complement: flip the bits 1 becomes 0, 0 becomes 1. ... – PowerPoint PPT presentation

Number of Views:14
Avg rating:3.0/5.0
Slides: 8
Provided by: csU79
Category:
Tags: fall | flip | number | systems

less

Transcript and Presenter's Notes

Title: CS 301 Fall 2002 Number Systems


1
CS 301 Fall 2002Number Systems
  • Slide Set 1

2
Bits, Bytes, and Words
  • A bit (binary digit) is 0 or 1
  • byte 8 bits
  • word 2 bytes (16-bit)
  • doubleword 2 words (32-bit)
  • quadword 4 words (64-bit)
  • kilobyte (K) 210 (1024) bytes
  • megabyte (M) 220 (1048576) bytes

3
Binary numbers
  • Bit 7 6 5 4 3 2 1 0
  • Value 128 64 32 16 8 4 2 1
  • Example 01000101 69

4
Negative Binary Numbers
  • Ones complement flip the bits 1 becomes 0, 0
    becomes 1.
  • Twos complement take ones complement, then add
    one. This is how the computer represents the
    negative.
  • Why? Because it works.Try -0, -1, and -13. (Check
    that adding -13 to 13 gives you 0)
  • Actually, it works because when you add anything
    to its ones complement, you get all ones. Adding
    one to that gives you 0 (with a carry out).

5
Hexadecimal representation
  • Base 16 Digits are 0123456789ABCDEF
  • Write with a trailing h 4A1Fh

Decimal Binary Hex Decimal Binary Hex
0 0000 0 8 1000 8
1 0001 1 9 1001 9
2 0010 2 10 1010 A
3 0011 3 11 1011 B
4 0100 4 12 1100 C
5 0101 5 13 1101 D
6 0110 6 14 1110 E
7 0111 7 15 1111 F
6
Hex and Binary Arithmetic
  • Just as decimal. Add corresponding columns, if
    the result is higher than the base, then carry.
  • To subtract, either use twos complement to find
    the negative and then add, or do as in base 10
    (borrow instead of carry)

7
Memory
  • 01000001 Is it 65 or A (ASCII) or floating
    point or something else?
  • However you look at it.
Write a Comment
User Comments (0)
About PowerShow.com