Docsity

Number System in Computer Science, Study notes of Applications of Computer Sciences

Partial preview of the text

Download Number System in Computer Science and more Study notes Applications of Computer Sciences in PDF only on Docsity!

1. Number Systems

Chapt. 2 Location in course textbook

Common Number Systems

System Base Symbols Used by humans? Used in computers? Decimal 10 0, 1, … 9 Yes No Binary 2 0, 1 No Yes Octal 8 0, 1, … 7 No No Hexa- decimal

A, B, … F

No No

Quantities/Counting (2 of 3)

Decimal Binary Octal Hexa- decimal 8 1000 10 8 9 1001 11 9 10 1010 12 A 11 1011 13 B 12 1100 14 C 13 1101 15 D 14 1110 16 E 15 1111 17 F

Quantities/Counting (3 of 3)

Decimal Binary Octal Hexa- decimal 16 10000 20 10 17 10001 21 11 18 10010 22 12 19 10011 23 13 20 10100 24 14 21 10101 25 15 22 10110 26 16 23 10111 27 17 Etc.

Quick Example

Base

Decimal to Decimal (just for fun)

Hexadecimal Decimal Octal Binary Next slide…

Binary to Decimal

Hexadecimal Decimal Octal Binary

Binary to Decimal

  • (^) Technique
    • (^) Multiply each bit by 2 n , where n is the “weight”

of the bit

  • (^) The weight is the position of the bit, starting

from 0 on the right

  • (^) Add the results

Octal to Decimal

Hexadecimal Decimal Octal Binary

Octal to Decimal

  • (^) Technique
    • (^) Multiply each bit by 8 n , where n is the “weight”

of the bit

  • (^) The weight is the position of the bit, starting

from 0 on the right

  • (^) Add the results

Hexadecimal to Decimal

Hexadecimal Decimal Octal Binary

Hexadecimal to Decimal

  • (^) Technique
    • (^) Multiply each bit by 16 n , where n is the

“weight” of the bit

  • (^) The weight is the position of the bit, starting

from 0 on the right

  • (^) Add the results

Decimal to Binary

Hexadecimal Decimal Octal Binary

Decimal to Binary

  • (^) Technique
    • (^) Divide by two, keep track of the remainder
    • (^) First remainder is bit 0 (LSB, least-significant

bit)

  • (^) Second remainder is bit 1
  • (^) Etc.