Professional Documents
Culture Documents
Assignment1 DLD Theory
Assignment1 DLD Theory
986.25×22 = 3945
Divide by the base 2 to get the digits from the remainders:
Division Remainder
by 2 Quotient (Digit) Bit #
(3945)/2 1972 1 0
(1972)/2 986 0 1
(986)/2 493 0 2
(493)/2 246 1 3
(246)/2 123 0 4
(123)/2 61 1 5
(61)/2 30 1 6
(30)/2 15 0 7
(15)/2 7 1 8
(7)/2 3 1 9
(3)/2 1 1 10
Division Remainder
by 2 Quotient (Digit) Bit #
(1)/2 0 1 11
= (111101101001)2 >> 2
= (1111011010.01)2
: decimal to octal
(986.25)10 to octal
(b):
Ans:
1101101.10112 in Binary number system and want to
translate it into Octal.
To do this, at first converting it to decimal here so :
1101101.10112 = 1∙26+1∙25+0∙24+1∙23+1∙22+0∙21+1∙20+1∙2-1+0∙2-
2
+1∙2-3+1∙2-4 = 64+32+0+8+4+0+1+0.5+0+0.125+0.0625 =
109.687510
Happened: 109.687510
109 8
-
13 8
104
5 -8 1
5
Happened:10910 = 1558
0 .6875
. 8
5 5
8
4 0
Happened:0.687510 = 0.548
Add up together whole and fractional part here so:
Result of converting:
1101101.10112 = 155.548
Problem No 2:
A) Perform the subtraction using r’s and r-1’s
complement.
(I). 1972-6842
Ans :
The (r-1)'s complement of a number in
anynumber system with base r can be found
out by subtracting every single digit of a
number by r-1.so
(1972-6842 ) =(5130)
The answer is (5130).
---------------------------------------------
(ii): (101101)2-(111001)2
Ans : same to the above question.
(101101)2-(111001)2 = (010100)2
B) Represent you student ID (like 786) in the
following Code.
I. BCD
Ans :
Binary Coded Decimal, or BCD, is another
process for converting decimal numbers into
their binary equivalents
Convert (324)10 in BCD
(324)10 -> 0011 0010 0100 (BCD)
Again from the truth table above,
3 -> 0011
2 -> 0010
4 -> 0100
thus, BCD becomes -> 0001 0010 0011
II. Excess-3 code
Ans: Decimal number 31
1. i find the BCD code of each digit of the decimal number.
Digit BCD
3 0011
1 0001
3 0011+0011 0110
1 0001+0011 0100