200 likes | 510 Views
Number System. Prepared By Dr. Anu Gokhale. Decimal, Binary, Octal, and Hex. Decimal is the number system that we use Binary is a number system that computers use
E N D
Number System Prepared By Dr. Anu Gokhale
Decimal, Binary, Octal, and Hex • Decimal is the number system that we use • Binary is a number system that computers use • Octal is a number system that represents groups of binary numbers (binary shorthand). It is used in digital displays, and in modern times in conjunction with file permissions under Unix systems. • Hexadecimal (Hex) is a number system that represents groups of binary numbers (binary shorthand). Hex is primarily used in computing as the most common form of expressing a human-readable string representation of a byte (group of 8 bits).
Decimal • The number system we are familiar with • Decimal number has base 10 • Each digit is a number from 0 to 9
Binary • Binary number has base 2 • Each digit is one of two numbers: 0 and 1 • Each digit is called a bit • Eight binary bits make a byte • All 256 possible values of a byte can be represented using 2 digits in hexadecimal notation.
Octal • Octal number has base 8 • Each digit is a number from 0 to 7 • Each digit represents 3 binary bits • Was used in early computing, but was replaced by hexadecimal
Hexadecimal • Hexadecimal number has base 16 • Each digit is a number from 0 to 15: digits 0 to 9, and the digits 10 through 15 are represented by A through F • A = 10 • B = 11 • C = 12 • D = 13 • E = 14 • F = 15 • Each digit represents 4 binary bits
One Byte Examples (1 of 2) Binary Octal Decimal Hex • 00000000 0 0 0 • 00000001 1 1 1 • 00000010 2 2 2 • 00000100 4 4 4 • 00001000 10 8 8 • 00010000 20 16 10 • 00100000 40 32 20 • 01000000 100 64 40 • 10000000 200 128 80
One Byte Examples … continued (2 of 2) • Binary Decimal Hex • 00010001 17 11 • 00001010 10 0A • 10101010 170 AA • 11000000 192 C0 • 11000001 193 C1 • 11100000 224 E0 • 11110000 240 F0 • 11111111 255 FF
QuestionsDecimal to Binary • Convert 8 decimal to binary. • 00001000 • Convert 88 decimal to binary. • 01011000 • Convert 204 decimal to binary. • 11001100 • Convert 255 decimal to binary. • 11111111
QuestionsBinary to Decimal • Convert 00101100 binary to decimal. • 44 • Convert 10000000 binary to decimal. • 128 • Convert 00001000 binary to decimal. • 8 • Convert 01010101 binary to decimal. • 85
Questions Binary to Octal • Convert 00101100 binary to octal. • 54 • Convert 10000000 binary to octal. • 200 • Convert 00001000 binary to octal. • 10 • Convert 01010101 binary to octal. • 125
QuestionsOctal to Binary • Convert 76 octal to binary. • 00111110 • Convert 15 octal to binary. • 00001101 • Convert 22 octal to binary. • 00010010 • Convert 3 octal to binary. • 00000011
Questions Binary to Hex • Convert 00101100 binary to hex. • 2C • Convert 10000000 binary to hex. • 80 • Convert 00001010 binary to hex. • A • Convert 11111111 binary to hex. • FF • What is this in decimal?
QuestionsHex to Binary • Convert 6C hex to binary. • 01101100 • Convert AE hex to binary. • 10101110 • Convert 22 hex to binary. • 00100010 • Convert 8 hex to binary. • 00001000
QuestionsDecimal to Hex • Convert 8 decimal to hex. • 8 • Convert 22 decimal to hex. • 16 • Convert 65 decimal to hex. • 41 • Convert 128 decimal to hex. • 80
Questions Hex to Decimal • Convert 22 hex to decimal. • 34 • Convert 34 hex to decimal. • 52 • Convert 6 hex to decimal. • 6 • Convert 82 hex to decimal. • 130
Online References • Highly recommended: • http://www.muhanna.info/11101/NumberingSystem.pdf • Good: • http://www.eecs.wsu.edu/~ee314/handouts/numsys.pdf • http://courses.cs.vt.edu/~cs1104/number_conversion/convexp.html