Jinsi ya kubadilisha binary kuwa decimal
Kwa nambari ya binary iliyo na nambari n:
d n-1 ... d 3 d 2 d 1 d 0
Nambari ya desimali ni sawa na jumla ya tarakimu za binary (d n ) mara nguvu zao za 2 (2 n ):
decimal = d 0 ×2 0 + d 1 ×2 1 + d 2 ×2 2 + ...
Mfano wa binary hadi decimal
Pata thamani ya desimali ya 100010 2 :
nambari ya binary: | 1 | 0 | 0 | 0 | 1 | 0 |
---|---|---|---|---|---|---|
nguvu ya 2: | 2 5 | 2 4 | 2 3 | 2 2 | 2 1 | 2 0 |
100010 2 = 1⋅2 5 +0⋅2 4 +0⋅2 3 +0⋅2 2 +1⋅2 1 +0⋅2 0 = 34 10
Mfumo wa decimal
Mfumo wa nambari za desimali ndio unaotumiwa zaidi na mfumo wa kawaida katika maisha ya kila siku. Inatumia nambari 10 kama msingi wake (radix). Kwa hiyo, ina alama 10: Nambari kutoka 0 hadi 9; yaani 0, 1, 2, 3, 4, 5, 6, 7, 8 na 9.
Mfumo wa binary
Mfumo wa nambari mbili hutumia nambari 2 kama msingi wake (radix). Kama mfumo wa nambari za msingi-2, ina nambari mbili tu: 0 na 1.
Jedwali la ubadilishaji la tarakimu hadi desimali
Nambari ya binary | Nambari ya decimal | Nambari ya Hex |
---|---|---|
0 | 0 | 0 |
1 | 1 | 1 |
10 | 2 | 2 |
11 | 3 | 3 |
100 | 4 | 4 |
101 | 5 | 5 |
110 | 6 | 6 |
111 | 7 | 7 |
1000 | 8 | 8 |
1001 | 9 | 9 |
1010 | 10 | A |
1011 | 11 | B |
1100 | 12 | C |
1101 | 13 | D |
1110 | 14 | E |
1111 | 15 | F |
10000 | 16 | 10 |
10001 | 17 | 11 |
10010 | 18 | 12 |
10011 | 19 | 13 |
10100 | 20 | 14 |
10101 | 21 | 15 |
10110 | 22 | 16 |
10111 | 23 | 17 |
11000 | 24 | 18 |
11001 | 25 | 19 |
11010 | 26 | 1A |
11011 | 27 | 1B |
11100 | 28 | 1C |
11101 | 29 | 1D |
11110 | 30 | 1E |
11111 | 31 | 1F |
100000 | 32 | 20 |
1000000 | 64 | 40 |
10000000 | 128 | 80 |
100000000 | 256 | 100 |