Presentation is loading. Please wait.

Presentation is loading. Please wait.

Integer Real Numbers Character Boolean Memory Address CPU Data Types

Similar presentations


Presentation on theme: "Integer Real Numbers Character Boolean Memory Address CPU Data Types"— Presentation transcript:

1 Integer Real Numbers Character Boolean Memory Address CPU Data Types
Chapter 3 Integer Real Numbers Character Boolean Memory Address

2 Integer Integer Whole numbers No decimal places Unsigned integers
Use entire by ( 8 or 6 bits) for number Lowest number is zero (0) Signed integers Use high order bit for + or – sign Octal machines have 5 bits for number (out of 6) Excess notation Hex machines have 7 bit for number (out of 8) Excess notation

3 Octal Integer 6 BIT number X X X X X X Weight value 32 16 8 4 2 1
All positions = “1” (“ON”) Not counted: used for sign Unsigned Signed

4 Hexadecimal Integer 8 BIT number X X X X X X X X
Weight value All positions = “1” (“ON”) Not counted: used for sign Unsigned Signed

5 Arithmetic Operations
Addition Subtraction Multiplication Division

6 Add two numbers Addition Decimal Binary Binary bit weights
=

7 Subtract two numbers Subtraction ? Answer is: 6 - 5 ----- 0
Decimal Binary Binary bit weights = * ? 1 2 3 4 Borrow 1 from 2s position add to 1s position Subtract 1s position Subtract 2s position 5 6 7 Answer is: Subtract 4s position Subtract 8s position

8 Complements Binary numbering scheme Ones (1) become zero (0)
Zeros (0) become ones (1) Octal Hexadecimal 0 000 = = = = = = = = = = = = = = = = = = A = B = C = D = E = F = 0000

9 Computers MULTIPLY, SUBTRACT and DIVIDE by ADDITION
Two’s Complement Computers MULTIPLY, SUBTRACT and DIVIDE by ADDITION Binary numbering scheme Used to work with negative numbers Ones (1) become zero (0) Zeros (0) become ones (1) Data is signed if: Variable data type was defined as signed in the program The number is converted in the program The computer does a Subtract or Divide Formula for conversion Original binary number Compliment the number Ones to Zeros Zeros to Ones Add binary one to lowest position High order carry's are discarded

10 Add two numbers Two’s Complement Decimal Binary Binary bit weights
=

11 * Two’s Compliment of 5 Subtract two numbers Two’s Complement
Decimal Binary Binary bit weights = * * Two’s Compliment of 5 5 = Original Compliment Add one Two’s compliment 1011

12 Subtraction Division Addition and Two’s Compliment Summary
Computers do Subtraction And Division Using Addition and Two’s Compliment


Download ppt "Integer Real Numbers Character Boolean Memory Address CPU Data Types"

Similar presentations


Ads by Google