Binary:: Base 2 and Base 10 Learn

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

Binary:

base 2 and base 10 learn


from:fitz

Let's look at base-two, or binary, numbers. How would you write, for instance,
1210 ("twelve, base ten") as a binary number? You would have to convert to
base-two columns, the analogue of base-ten columns. In base ten, you have

columns or "places" for 100 = 1, 101 = 10, 102 = 100, 103 = 1000,
and so forth. Similarly in base two, you have columns or "places" for 20 = 1,
21 = 2, 22 = 4, 23 = 8, 24 = 16, and so forth.

The first column in base-two math is the units column. But only "0" or "1" can
go in the units column. When you get to "two", you find that there is no single
solitary digit that stands for "two" in base-two math. Instead, you put a "1" in

the twos column and a "0" in the units column, indicating "1 two and 0 ones".

The base-ten "two" (210) is written in binary as 102.

A "three" in base two is actually "1 two and 1 one", so it is written as 112.
"Four" is actually two-times-two, so we zero out the twos column and the

units column, and put a "1" in the fours column; 410 is written in binary form

as 1002. Here is a listing of the first few numbers:

decimal binary
(base 10) (base 2)
0 0 0 ones
1 1 1 one
2 10 1 two and zero ones
3 11 1 two and 1 one
1 four, 0 twos, and 0 ones
4 100
1 four, 0 twos, and 1 one
5 101
1 four, 1 two, and 0 ones
6 110
1 four, 1 two, and 1 one
7 111
1 eight, 0 fours, 0 twos, and 0 ones
8 1000
1 eight, 0 fours, 0 twos, and 1 one
9 1001
1 eight, 0 fours, 1 two, and 0 ones
10 1010
1 eight, 0 fours, 1 two, and 1 one
11 1011
1 eight, 1 four, 0 twos, and 0 ones
12 1100
1 eight, 1 four, 0 twos, and 1 one
13 1101
1 eight, 1 four, 1 two, and 0 ones
14 1110
1 eight, 1 four, 1 two, and 1 one
15 1111
1 sixteen, 0 eights, 0 fours, 0 twos, and
16 10000
0 ones

Converting between binary and decimal numbers is fairly simple, as long as you
remember that each digit in the binary number represents a power of two.

 Convert 1011001012 to the corresponding base-ten number.

I will list the digits in order, and count them off from the RIGHT, starting with
zero:

1  0   1  1  0 
digits:  
0  1  0  1

Numbering
for the 8  7   6  5 
base
4  3  2  1  0
nombor
diatas >

The first row above (labelled "digits") contains the digits from the binary
number; the second row (labelled " numbering") contains the power of
2 (the base) corresponding to each digits. I will use this listing to
convert each digit to the power of two that it represents:

1×28 + 0×27 + 1×26 + 1×25 + 0×24 + 0×23 + 1×22


+ 0×21 + 1×20

    = 1×256 + 0×128 + 1×64 + 1×32 + 0×16 +


0×8 + 1×4 + 0×2 + 1×1

    = 256 + 64 + 32 + 4 + 1

    = 357

Jawapan ialah : 1011001012 converts to 35710.

Converting decimal numbers to binaries is nearly as simple: just divide by 2.


[ sekarang nombor tadi 35710 ditukarkan kepade base 2 balik]

As you can see, after dividing repeatedly by 2, I ended up with these remainders:

CONTOH TENGOK !!!


Jawapanye cume amik yg tepi2[yg baki] start dri bwah > 1 0 1 0 0 1 1 0
jgn lupe tulis base 2 >1 0 1 0 0 1 1 02

Base 4

 Convert 35710 to the corresponding base-four number.

I will do the same division that I did before, keeping track of the
remainders. (You may want to use scratch paper for this.)

Then 35710 converts to 112114.

Note:Base 4 jugak same mcm base 2

 Convert 80710 to the corresponding base-four number.

Note: Once I got "3" on top, I had to stop, because four cannot divide

into 3. Stop sb da xboleh bahagi 4 ngn 3.. jd jawapanye ialah : 3 0 2


1 34
 note : bile nombor 3 yg last xleh nk bahagi kene start dri numbor 3 ^
atas pastu bru 0 , 2 ,1 ,3 letak jawapan…

Reading the numbers off the division, I get that 80710 converts to

302134.

Utk base 4 ke base 10 pulak tidak dpt di note kn sb


susah….xpew cube pham kn base 7

Base 7

 Convert 35710 to the corresponding base-seven number.

I do the division:

Then 35710 = 10207.

 Convert 1334610 to the corresponding base-seven number.

Tgok convert base 10 to corresponding kene pham kan


Then 1334610 = 536247.

Skg nie cara nk tukar base 7 ke base 10 :

 Convert 536247 to the corresponding decimal number.

I will list the digits, and count them off from the RIGHT, starting at
zero:

5  3   6 
digits:  
2  4
4  3   2 
numbering:
1  0

Then I'll do the multiplication and addition:

5×74 + 3×73 + 6×72 + 2×71 + 4×70


    = 5×2401 + 3×343 + 6×49 + 2×7 + 4×1
    = 12005 + 1029 + 294 + 14 + 4
    = 13346

Then 536247 = 1334610.

Number Bases: Octal (Base 8)

Octal
An older computer base system is "octal", or base eight. The digits in octal
math are 0, 1, 2, 3, 4, 5, 6, and 7. The value "eight" is written as "1

eight and 0 ones", or 108.

 Convert 35710to the corresponding base-eight number.

I will do the usual repeated division, this time dividing by 8 at each


step:

Then the corresponding octal number is 5458.

Skrg base 8 ke base 10 pulak

 Convert 5458 to the corresponding decimal number.

I will follow the usual procedure, counting off the digits from the RIGHT,
starting at zero:

5  4  
digits:  
5
2  1  
numbering:
0

Then I'll do the addition and multiplication:


5×82 + 4×81 + 5×80
      = 5×64 + 4×8 + 5×1
      = 320 + 32 + 5
      = 357

Then the corresponding decimal number is 35710.

Hexadecimal [perenambelasan]
If you work with computer programming or computer engineering (or computer graphics,
about which more later), you will encounter base-sixteen, or hexadecimal, math.

As mentioned before, decimal math does not have one single solitary digit that
represents the value of "ten". Instead, we use two digits, a 1 and a 0: "10". But in
hexadecimal math, the columns stand for multiples of sixteen! That is, the first column
stands for how many units you have, the second column stands for how many sixteens,
the third column stands for how many two hundred fifty-sixes (sixteen-times-sixteens),
and so forth.

In base ten, we had digits 0 through 9. In base eight, we had digits 0 through 7. In

base 4, we had digits 0 through 3. In any base system, you will have digits 0
through one-less-than-your-base. This means that, in hexadecimal, we need to have
"digits" 0 through 15. To do this, we would need single solitary digits that stand for
the values of "ten", "eleven", "twelve", "thirteen", "fourteen", and "fifteen". But we
don't. So, instead, we use letters. That is, counting in hexadecimal, the sixteen
"numerals" are:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

In other words, A is "ten" in "regular" numbers, B is "eleven", C is "twelve", D is

"thirteen", E is "fourteen", and "F" is fifteen.  It is this use of letters for digits that
makes hexadecimal numbers look so odd at first. But the conversions work in the usual
manner.
Translate :

Jika anda bekerja dengan pengaturcaraan komputer atau teknik komputer (atau
komputer grafik, tentang yang lebih kemudian), anda akan menemui asas-enam belas,
atau Perenambelasan, matematik.

Seperti disebutkan sebelumnya, matematik perpuluhan tidak memiliki satu pun soliter
angka yang merupakan nilai dari "sepuluh". Sebaliknya, kami menggunakan dua digit, 1
dan 0: "10". Tetapi dalam matematik Perenambelasan, medan berdiri untuk kelipatan
enam belas! Ertinya, medan pertama singkatan dari berapa unit yang anda miliki, medan
kedua singkatan berapa sixteens, medan ketiga singkatan berapa banyak dua ratus lima
puluh-berenam (enam belas-kali-sixteens), dan sebagainya.

Dalam sepuluh dasar, kami harus angka 0 hingga 9. Dalam pangkalan lapan, kami harus

angka 0 hingga 7. Dalam pangkalan 4, kami harus angka 0 hingga 3. Dalam setiap

sistem asas, anda akan mempunyai nombor 0 sampai satu-kurang dari-anda-base-. Ini

bermakna bahawa, dalam Perenambelasan, kita perlu memiliki "angka" 0 hingga 15.
Untuk melakukan ini, kita perlu soliter digit tunggal yang berdiri untuk nilai dari
"sepuluh", "sebelas", "dua belas", "tiga belas", "empat belas", dan "lima belas". Tapi kita
tidak. Jadi, sebaliknya, kita menggunakan huruf. Ertinya, menghitung dalam
Perenambelasan, enam belas "nombor" adalah:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

Dengan kata lain, A adalah "sepuluh" dalam "biasa" nombor, B "sebelas", C adalah "dua

belas", D adalah "tiga belas", E "empat belas", dan "F" adalah lima belas. Ini adalah
penggunaan huruf untuk angka yang membuat nombor-nombor Perenambelasan jadi
terlihat aneh pada awalnya. Tetapi penukaran bekerja dengan cara biasa.

Lihat base 10 ke base 16 :

 Convert 35710 to the corresponding hexadecimal number.


Here, I will divide repeatedly by 16, keeping track of the remainders as I
go. (You might want to use some scratch paper for this.)

Reading off the digits, starting from the top and wrapping around the

right-hand side, I see that 35710 = 16516.

Lihat base 16 ke base 10

 Convert 16516 to the corresponding decimal number.

List the digits, and count them off from the RIGHT, starting with zero:

1  6  
digits:  
5
2  1  
numbering:
0

Remember that each digit in the hexadecimal number represents how


many copies you need of that power of sixteen, and convert the number
to decimal:

1×162 + 6×161 + 5×160


     = 1×256 + 6×16 + 5×1
     = 256 + 96 + 5
     = 357

Then 16516 = 35710.


Sekarang nie pelik sikit sb nombor lebih 9 diguna kn huruf :

 Convert 6393310 to the corresponding hexadecimal number.

Kite kene gune huruf utk jawapan kalau kite xboleh bahagi lagi contoh diatas xleh
lg bahagi dgn 16 ngn 15 tp kalau die bkn 15 die bwah dari 10 contoh 9 ,8 ,7 ,6
,5 ,4 ,3 ,2 ,1 , 0 xboleh gune huruf

From the long division, I can see that the hexadecimal number will have a
"fifteen" in the sixteen-cubeds column, a "nine" in the sixteen-squareds column,
an "eleven" in the sixteens column, and a "thirteen" in the ones column. But I

cannot write the hexadecimal number as "1591113", because this would be


confusing and imprecise. So I will use the letters for the "digits" that are
otherwise too large, letting "F" stand in for "fifteen", "B" stand in for

"eleven", and "D" stand in for "thirteen".   Copyright © Elizabeth Stapel 1999-2011 All
Rights Reserved

Then 6393310 = F9BD16.

 Convert F9BD to decimal notation.

I will list out the digits, and count them off from the RIGHT, starting at
zero:
F  9  
digits:  
B  D
3  2   
numbering:
1  0

Actually, it will probably be helpful to redo this, converting the alphabetic


hexadecimal "digits" to their corresponding "regular" decimal values:

digits:   15 9 11  13
numbering:   3 2 1  0

Now I'll do the multiplication and addition:

15×163 + 9×162 + 11×161 + 13×160


      = 15×4096 + 9×256 + 11×16 + 13×1
      = 61440 + 2304 + 176 + 13
      = 63933

As expected, F9BD = 6393310.

You might also like