Presentation is loading. Please wait.

Presentation is loading. Please wait.

Base 16 (hexadecimal) Uses the decimal digits and the first letters of the alphabet to encode 4 binary bits (16=2 4 ) 0123456789abcdef or 0123456789ABCDEF.

Similar presentations


Presentation on theme: "Base 16 (hexadecimal) Uses the decimal digits and the first letters of the alphabet to encode 4 binary bits (16=2 4 ) 0123456789abcdef or 0123456789ABCDEF."— Presentation transcript:

1 Base 16 (hexadecimal) Uses the decimal digits and the first letters of the alphabet to encode 4 binary bits (16=2 4 ) 0123456789abcdef or 0123456789ABCDEF

2 Base 16 (hexadecimal) Two hex digits encode each 8 bit byte Each 4 bit hex digit is a “nibble” In C and C++, a hexadecimal constant is flagged by an initial '0x' prefix 0x01=1 16 =1 10 0x10=10 16 =16 10 0x24=24 16 =36 10 0xff=0xFF=FF 16 =255 10

3 Base 16 (hexadecimal) Resources: –"man ascii" for ASCII text encoding in hex –"man bc" for conversion between bases –numerous graphical calculations –"man xxd" for dumping files in hex and text

4 Base 16 (hexadecimal) Exercises 1. Use 'bc' to convert 0x34a3f to base 10 2. Write a C program to convert 0x55AF3 to base 8


Download ppt "Base 16 (hexadecimal) Uses the decimal digits and the first letters of the alphabet to encode 4 binary bits (16=2 4 ) 0123456789abcdef or 0123456789ABCDEF."

Similar presentations


Ads by Google