Binary Arithmetic

Chapter 4 of the textbook.

Binary is base 2.

Hexadecimal Numbers

Hexadecimal is base 16.

Four binary bits = one hexadecimal digit.

It is far easier for programmers to write down than binary!

Binary Decimal Hexadecimal
0000 0 0
0001 1 1
0010 2 2
0011 3 3
0100 4 4
0101 5 5
0110 6 6
0111 7 7
Binary Decimal Hexadecimal
1000 8 8
1001 9 9
1010 10 A
1011 11 B
1100 12 C
1101 13 D
1110 14 E
1111 15 F

Unsigned Binary Numbers

1010two = 1 x 23 + 0 x 22 + 1 x 21 + 0 x 20ten = 8 + 2ten = 10ten

 1111two
+ 101two
 ----
10100two
=====

This number representation is fine for addition but what about subtraction?

We need to be able to represent negative numbers.


CSE 378 Spring 2002 - Section 1
First Previous Page 1 Next Last