Unit 1.3 -- Hex Notation and Arithmetic

Schaum, Chapter 1

SILVER, Section 1.2

POP pages A-1 to A-4

  

Hex

- base sixteen (just like binary = base 2 and decimal = base 10)

- method of shortening long binary numbers

- used for communicating between humans and computers

 

IBM Assembler Listing and Debugger use Hex

 

Hex digits:

0-9,A-E

where,

A=10

B=11

C=12

D=13

E=14

F=15

 

Groups of four binary digits = one hex digit

 

Example

 

0110 1011 =6B hex

1111 0111 =F7 hex

 

To add two hex numbers

 

1) convert each number to binary

2) use binary addition procedure

3) convert result back to hex

 

To subtract two hex numbers

 

1) convert each number to binary

2) use binary subtraction procedure

3) convert result back to hex

 

We can also do addition in hex itself. This addition is the

same as decimal addition EXCEPT we use a sixteen by sixteen

addition table instead of a ten by 10 addition table, and we

carry (or borrow) sixteen's not ten's.