0% found this document useful (0 votes)
66 views4 pages

Cs302 Assign 1

The document contains solutions to two questions: 1) It performs arithmetic operations on numbers in different bases and converts the result to the Caveman Number System. The result is (-2134231111)5. 2) It converts a hexadecimal number to binary and then gray code. It also finds the excess-7 code for an octal number by converting it to binary. The document provides step-by-step workings to solve problems involving number conversions between different bases, including hexadecimal, binary, octal, and the Caveman Number System.

Uploaded by

Umer Aslam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views4 pages

Cs302 Assign 1

The document contains solutions to two questions: 1) It performs arithmetic operations on numbers in different bases and converts the result to the Caveman Number System. The result is (-2134231111)5. 2) It converts a hexadecimal number to binary and then gray code. It also finds the excess-7 code for an octal number by converting it to binary. The document provides step-by-step workings to solve problems involving number conversions between different bases, including hexadecimal, binary, octal, and the Caveman Number System.

Uploaded by

Umer Aslam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

CS302

Question no 1
Perform the following arithmetic operations on given data, you can
use indirect conversion or repeated division methods only. Convert
the result into Caveman Number system.
 6 F 4 DE 2  H   3476423 0   1011010101010101011101 B        5   9877693 D
Solution :
Step1:
(6 F 4 DE 2) H  (?) D
 6 F 4 DE 2  16  (6 165 )  (15*164 )  (4*163 )  (13*162 )  (14*161 )  (2*160 )
 6 F 4 DE 2  16  6291456  983040  16384  3328  224  2
 6 F 4 DE 2  16  7294434D
Step 2 :
(3476423) 0  (?) D
(3476423)8  (3*86 )  (4*85 )  (7 *84 )  (6*83 )  (4*82 )  (2*81 )  (3*80 )
(3476423)8  786432  131072  28672  3072  256  16  3
(3476423)8  949523D
Step3 :
101101010101010101111012  (?)10
101101010101010101111012  (1* 221 )  (0* 2 20 )  (1* 219 )  (1* 218 )  (0* 217 )  (1* 216 )
101101010101010101111012  (0* 215 )  (1* 214 )  (0* 213 )  (1* 212 )  (0* 211 )  (1* 210 )
101101010101010101111012  (0* 29 )  (1* 28 )  (0* 2 7 )  (1* 26 )  (0* 25 )  (1* 24 )  (1* 23 )
101101010101010101111012  (1* 2 2 )  (0* 21 )  (1* 2 0 )
101101010101010101111012  2097152  0  524288  262144  0  65536  0  16384  0  4096
101101010101010101111012  0  1024  0  256  0  64  0  16  8  4  0  1
101101010101010101111012  297097310
Step 4 :
(   )5  (?) D
(   )5  *54   *53   *52   *51   *50
(   )5  *625   *125  *25   *5   *1
(   )5  4*625  1*125  2* 25* 0*5  3*1
(   )5  2500  125  50  0  3
(   )5  2678
(   )5  (2678) D
 6 F 4 DE 2  H   3476423 0   1011010101010101011101 B        5   9877693 D
 7294434  949523  2970973  2678  9877693
 8246635  12848666
 4602031

Solution:
5 -4602031 Reminder
5 920406 1
5 184081 1
5 36816 1
5 7363 1
5 1472 3
5 294 2
5 58 4
5 11 3
2 1

( 2134231111)5

Convert this base 5 number to Caveman Number System


(2134231111)  (     )

Question No.2
( FE 45EA) H
Convert into the Grey Code.
Solution:

Convert the hexadecimal number ( FE 45EA) H to binary by replacing the


each hexadecimal symbol with appropriate four bits binary number.
Step 1:
Hexa F E 4 5 E A
Number
Binary 1111 1110 0100 0101 1110 1010
number

Step 2:
Binary 1111 1110 0100 0101 1110 1010
Number
Gray 1000 1001 0110 0111 1001 1111
Code
So, the Grey Code is = 10001001011001111001111
Question No.2 (Part B)

 Find the equivalence Excesss-7 code for the number  76372  o


Solution
Convert octal number to Excess 7
Octal 7 6 3 7 2
Number
Adding 8 8 8 8 8 8
We get 15 14 11 15 10
Convert 1111 1110 1011 1111 1010
into
binary
each bit

Equivalent Excess-7 code for the number  76372  o is equal to


(11111110101111111010)

You might also like