Answer on Question #77384, Programming & Computer Science / Other
1. Convert the following unsigned binary numbers to a decimal base: 011011, 001001
Solution:
0110112=(0×25+1×24+1×23+0×22+1×21+1×20)(10)==(16+8+0+2+1)10=(16+8+2+1)10=27100010012=(0×25+0×24+1×23+0×22+0×21+1×20)(10)==(8+0+0+1)10=910
2. Convert the following decimal numbers to a binary base: 33, 44
Solution:
Divide the number repeatedly by 2, keeping track of each remainder, until we get a quotient that is equal to zero
division=quotient+remainder;33÷2=16+1;16÷2=8+0;8÷2=4+0;4÷2=2+0;2÷2=1+0;1÷2=0+1;3310=100001244÷2=22+0;22÷2=11+0;11÷2=5+1;5÷2=2+1;2÷2=1+0;1÷2=0+1;4410=1011002
3. Convert the following unsigned binary number to hexadecimal base: 01101101, 0010010111
Solution:
01101101
11011012=6D16=0×6D
0010010111
00100101112=9716=0×97
4. Convert the following hexadecimal numbers to a binary base: 0xEA5D, 0x11A
Solution:
0xEA5D
0xEA5D16=5999710
59997 to binar
0xEA5D16=5999710=11101010010111012
0x11A to decimal:
0x11A16=28210
282 to binary:
0×11A16=28210=1000110102
5. In the following perform addition of unsigned binary numbers. Solve each problem and convert your result to a decimal base for verification (a) 0101 + 0001, (b) 1101 + 1110, (c) 0111 + 1000, (d) 0111 + 1010
Solution:
(a)
```
001 (carry)
0101
+0001
0110
```
0101+0001=0110
Verification
01012=(0×23+1×22+0×21+1×20)(10)==(0+4+0+1)10=51000012=11001102=(0×23+1×22+1×21+0×20)(10)==(0+4+2+0)10=6105+1=6
(b)
```
1100 (carry)
1101
+1110
11011
```
1101+1110=11011
Verification
11012=(1×23+1×22+0×21+1×20)(10)==(8+4+0+1)10=131011102=(1×23+1×22+1×21+0×20)(10)==(8+4+2+0)10=1410110112=(1×24+1×23+0×22+1×21+0×20)(10)==(16+8+0+2+1)10=271013+14=27
(c)
00(carry)0111+100011110111+1000=1111
Verification
01112=(0×23+1×22+1×21+1×20)(10)==(0+4+2+1)10=71010002=(1×23+0×22+0×21+0×20)(10)==(8+0+0+0)10=81011112=(11×23+1×22+1×21+1×20)(10)==(8+4+2+1)10=15107+8=15
(d) 0111 + 1010
111(carry)0111+1010100010111+1010=10001
Verification
01112=(0×23+1×22+1×21+1×20)(10)==(0+4+2+1)10=71010102=(1×23+0×22+1×21+0×20)(10)==(8+0+2+0)10=1010100012=(1×24+0×23+0×22+0×21+1×20)(10)==(16+0+0+0+1)10=17107+10=17
Answer: (a) 0110; (b) 11011; (c) 1111; (d) 10001
6. Find the decimal equivalent for each binary fraction.
a. 1101.0111
b. 111.111
c. 101.01011
**Solution:**
a.
1101.01112==(1×23+1×22+0×21+1×20+0×2−1+1×2−2+1×2−3+1×2−4)(10)==(8+4+0+0+0.25+0.125+0.0625)10=13.437510
b. 111.111
111.1112==(1×22+1×21+1×20+1×2−1+1×2−2+1×2−3)(10)==(4+2+1+0.5+0.25+0.125)10=7.87510
c. 101.01011
101.010112==(11×22+0×21+1×20+0×2−1+1×2−2+0×2−3+1×2−4+1×2−5)(10)==(4+0+1+0.25+0.0625+0.03125)10=5.3437510
**Answer:** a) 13.4375; b) 7.875; c) 5.34375.
7. Find the binary equivalent for each decimal fraction.
a. 32.45
b. 28.555
c. 7.0202
**Solution:**
a. 32.45
First, convert to binary (base 2) the integer part: 32. Divide the number repeatedly by 2, keeping track of each remainder, until we get a quotient that is equal to zero:
division = quotient + remainder;
32÷2=16+0;16÷2=8+0;8÷2=4+0;4÷2=2+0;2÷2=1+0;
2. Construct the base 2 representation of the integer part of the number, by taking all the remainders starting from the bottom of the list constructed above:
32_{10} = 100000_{2}
3. Convert to binary (base 2) the fractional part: 0.45. Multiply it repeatedly by 2, keeping track of each integer part of the results, until we get a fractional part that is equal to zero:
#) multiplying = integer + fractional part;
1) 0.45 × 2 = 0 + 0.9;
2) 0.9 × 2 = 1 + 0.8;
3) 0.8 × 2 = 1 + 0.6;
4) 0.6 × 2 = 1 + 0.2;
5) 0.2 × 2 = 0 + 0.4;
6) 0.4 × 2 = 0 + 0.8;
7) 0.8 × 2 = 1 + 0.6;
8) 0.6 × 2 = 1 + 0.2;
9) 0.2 × 2 = 0 + 0.4;
10) 0.4 × 2 = 0 + 0.8;
11) 0.8 × 2 = 1 + 0.6;
12) 0.6 × 2 = 1 + 0.2;
13) 0.2 × 2 = 0 + 0.4;
14) 0.4 × 2 = 0 + 0.8;
15) 0.8 × 2 = 1 + 0.6;
16) 0.6 × 2 = 1 + 0.2;
17) 0.2 × 2 = 0 + 0.4;
18) 0.4 × 2 = 0 + 0.8;
19) 0.8 × 2 = 1 + 0.6;
20) 0.6 × 2 = 1 + 0.2;
21) 0.2 × 2 = 0 + 0.4;
22) 0.4 × 2 = 0 + 0.8;
23) 0.8 × 2 = 1 + 0.6;
24) 0.6 × 2 = 1 + 0.2;
We didn’t get any fractional part that was equal to zero. But we had enough iterations (over Mantissa limit) and at least one integer that was different from zero
0.45_{10} = 0.0111 0011 0011 0011 0011 0011_{2}
32.45_{10} = 10 0000.0111 0011 0011 0011 0011 0011_{2}
b. 28.555
1. First, convert to binary (base 2) the integer part: 28. Divide the number repeatedly by 2, keeping track of each remainder, until we get a quotient that is equal to zero:
division = quotient + remainder;
28 ÷ 2 = 14 + 0;
14÷2=7+0;7÷2=3+1;3÷2=1+1;1÷2=0+1;
2. Construct the base 2 representation of the integer part of the number, by taking all the remainders starting from the bottom of the list constructed above:
2810=111002
3. Convert to binary (base 2) the fractional part: 0.555. Multiply it repeatedly by 2, keeping track of each integer part of the results, until we get a fractional part that is equal to zero:
#) multiplying = integer + fractional part;
1) 0.555×2=1+0.11;
2) 0.11×2=0+0.22;
3) 0.22×2=0+0.44;
4) 0.44×2=0+0.88;
5) 0.88×2=1+0.76;
6) 0.76×2=1+0.52;
7) 0.52×2=1+0.04;
8) 0.04×2=0+0.08;
9) 0.08×2=0+0.16;
10) 0.16×2=0+0.32;
11) 0.32×2=0+0.64;
12) 0.64×2=1+0.28;
13) 0.28×2=0+0.56;
14) 0.56×2=1+0.12;
15) 0.12×2=0+0.24;
16) 0.24×2=0+0.48;
17) 0.48×2=0+0.96;
18) 0.96×2=1+0.92;
19) 0.92×2=1+0.84;
20) 0.84×2=1+0.68;
21) 0.68×2=1+0.36;
22) 0.36×2=0+0.72;
23) 0.72×2=1+0.44;
24) 0.44×2=0+0.88;
4. Construct the base 2 representation of the fractional part of the number, by taking all the integer parts of the multiplying operations, starting from the top of the constructed list above:
0.55510=0.100011100001010001111010228.55510=11100.1000111000010100011110102
c. 7.0202
1. First, convert to binary (base 2) the integer part: 7. Divide the number repeatedly by 2, keeping track of each remainder, until we get a quotient that is equal to zero:
division = quotient + remainder;
7 ÷ 2 = 3 + 1;
3 ÷ 2 = 1 + 1;
1 ÷ 2 = 0 + 1;
2. Construct the base 2 representation of the integer part of the number, by taking all the remainders starting from the bottom of the list constructed above:
710=1112
3. Convert to binary (base 2) the fractional part: 0.020 2. Multiply it repeatedly by 2, keeping track of each integer part of the results, until we get a fractional part that is equal to zero:
#) multiplying = integer + fractional part;
1) 0.020 2 × 2 = 0 + 0.040 4;
2) 0.040 4 × 2 = 0 + 0.080 8;
3) 0.080 8 × 2 = 0 + 0.161 6;
4) 0.161 6 × 2 = 0 + 0.323 2;
5) 0.323 2 × 2 = 0 + 0.646 4;
6) 0.646 4 × 2 = 1 + 0.292 8;
7) 0.292 8 × 2 = 0 + 0.585 6;
8) 0.585 6 × 2 = 1 + 0.171 2;
9) 0.171 2 × 2 = 0 + 0.342 4;
10) 0.342 4 × 2 = 0 + 0.684 8;
11) 0.684 8 × 2 = 1 + 0.369 6;
12) 0.369 6 × 2 = 0 + 0.739 2;
13) 0.739 2 × 2 = 1 + 0.478 4;
14) 0.478 4 × 2 = 0 + 0.956 8;
15) 0.956 8 × 2 = 1 + 0.913 6;
16) 0.913 6 × 2 = 1 + 0.827 2;
17) 0.827 2 × 2 = 1 + 0.654 4;
18) 0.654 4 × 2 = 1 + 0.308 8;
19) 0.308 8 × 2 = 0 + 0.617 6;
20) 0.617 6 × 2 = 1 + 0.235 2;
21) 0.235 2 × 2 = 0 + 0.470 4;
22) 0.470 4 × 2 = 0 + 0.940 8;
23) 0.940 8 × 2 = 1 + 0.881 6;
24) 0.881 6 × 2 = 1 + 0.763 2;
4. Construct the base 2 representation of the fractional part of the number, by taking all the integer parts of the multiplying operations, starting from the top of the constructed list above:
0.0202₁₀ = 0.0000 0101 0010 1011 1101 0011₂
7.020210=111.0000010100101011110100112
Answer: a) 10 0000.0111 0011 0011 0011 0011 0011_2;
b) 11100.1000 1110 0001 0100 0111 1010_2;
c) 111.0000 0101 0010 1011 1101 0011_2
Answer provided by www.AssignmentExpert.com
Comments