Sie sind auf Seite 1von 34

Introduction to Computers

Suhaemi Pasinringi, M.T.I.


suhemi@trisakti.ac.id
suhaemi@mat.co.id
suhaemi@megatama.co.id
pasinringi@gmail.com

Universitas Trisakti
Number Systems (Sistem Bilangan)

Universitas Trisakti
Introduction
 Decimal
 Base-10 number system / radix of 10
 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

 Binary
 Base-2 number system / radix of 2
 0, 1
 Octal
 Base-8 number system / radix of 8
 0, 1, 2, 3, 4, 5, 6, 7

Universitas Trisakti
Introduction (cont…)
 Hexadecimal
 Base-16 number system / radix of 16
 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

 Easy to covert binary to & from octal/hex,


since radix of octal/hex system is a power
of 2 (the radix of the binary system).
8 = 23
 16 = 24

Universitas Trisakti
Decimal

Universitas Trisakti
Binary

Universitas Trisakti
Octal

Universitas Trisakti
Hexadecimal

Universitas Trisakti
Decimal to Decimal
32410 = ... Decimal? 2510 = ... Decimal?

32410 = 32410 2510 = 2510

Universitas Trisakti
32410 = ... Binary?
Decimal to Binary
2510 = ... Binary?

32410 = 1010001002 2510 = 110012


Universitas Trisakti
Decimal to Octal
32410 = ... Octal? 5710 = ... Octal?

32410 = 5048 5710 = 718

Universitas Trisakti
Decimal to Hexadecimal
32410 = ... Hex? 65210 = ... Hex?

32410 = 14416 65210 = 28C16

16510 = ... Hex? 16510 = A516


Universitas Trisakti
Binary is Unique

16710 = … Binary?

Universitas Trisakti
16710 = 101001112
Universitas Trisakti
101001012 = … Decimal?

101001012 = 128 + 32 + 4 + 1 = 16510


Universitas Trisakti
Binary to Octal / Octal to Binary

101001112 = 2478

Universitas Trisakti
Binary to Octal / Octal to Binary
12410 = 11111002 = ... Octal?

12410 = 11111002 = 1748

Universitas Trisakti
Binary to Hex / Hex to Binary

101001112 = A716

Universitas Trisakti
Binary to Hex / Hex to Binary
69510 = 1010110111 = ... Hexadecimal?

69510 = 10101101112 = 2B716

Universitas Trisakti
Octal to Hex

2478 = A716

Universitas Trisakti
Hex to Octal

A716 = 2478

Universitas Trisakti
Binary Arithmetic

Universitas Trisakti
Binary Addition
Three-step algorithm:
 STEP 1: Add the first (rightmost) column.
 STEP 2: Record the units digits of the
column sum. If the sum, exceeds 1, carry
the 1 digit, to the next column.
 STEP 3: If there are additional columns or if
there is a carry from Step 2, add the next
column and repeat Step 2. Otherwise stop.

Universitas Trisakti
Binary Addition (cont…)
Binary Addition Table:
+ 0 1
0 0 1
1 1 10

Binary Addition Facts:

Universitas Trisakti
Binary Addition (cont…)

Universitas Trisakti
Binary Multiplication
Since there are only two digits in binary,
there are only two possible outcomes of
each partial multiplication:
 If the digit in B is 0, the partial product is
also 0.
 If the digit in B is 1, the partial product is
equal to A.

Universitas Trisakti
Binary Multiplication (cont…)

Universitas Trisakti
Binary Multiplication (cont…)

Universitas Trisakti
Binary Subtraction
Two-step algorithm:
 STEP 1: If the lower (subtrahend) digit is
greater than the upper (minuend) digit,
borrow from the next column to the left.
 STEP 2: Subtract the lower value from the
upper value.
In Step 1, “borrowing” means appropriating
with no intention of paying back.

Universitas Trisakti
Binary Subtraction (cont…)

Binary Subtraction Facts:

Universitas Trisakti
Binary Subtraction (cont…)

Universitas Trisakti
Binary Division
 Binary division is similar to its decimal
counterpart.
 The procedure of binary division is the
same as that of decimal long division.

Universitas Trisakti
Binary Division (cont…)

The quotient is 11101. The quotient is 10010,


with a remainder 1.

Universitas Trisakti
Binary Division (cont…)

The quotient is 11101. The quotient is 10010,


with a remainder 1.

Universitas Trisakti

Das könnte Ihnen auch gefallen