[go: up one dir, main page]

0% found this document useful (0 votes)
12 views21 pages

Digital Logic Assignment

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

Digital Logic Assignment

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

Rathod Riya

23BAl0074
Assignmenti

3-). Conrert the following binary numbers to decimal

25+ O2+1 23+| 22+| * 2l+0 º20 32

2 MOlO:

20 =lat+32+l%0+4+0= ll

So,lOlO(2)=l1140)
3 lOlOl00.
284 27+O26+25+|24+ 0º23 | 2

0+32+lbt0+4+0+02436

So,llQlol00)=3640)
Rathod Riya
23BATIO074

3-2. Convert the following nymbers with the indicated


bases to decimal

J 121219.
*3+2 *33 ) *32+ 2 *3 1+| *3 = 81 + 54+9

So, 12121(3) 1140)


2 43IOS)
y534352 +1-51 +0:50 =S00+15+S+0=S80
So, 4310S= S804O)
350()
S*7t0*7°-35 +0= 35
So, S0(1)=3540)

So, 1984=2604O)
Rathod Riya
23BATlO074

3-3.Convert the following decimal numbers to binary

1231/2 alals remainderl


G1Sl2 =301remainderl
301/2 a153 remainderl
S3/2= la remainder L
Tol2 = 38 remainder 0
38/2 =19 remainder )
19/2=9 remainderl
9/2= 4remainderl
4 2 2 remaindder 0
2/2 =lremainder 0
I/2=0 remainderl

Reading the remainders from bottom to top


123100)l00l00(2)
261340)
613/2-336remainderl
3362albremainder O
Rathod Riya
23BATl0074

l68/2 = 84remainder O
84/2 = 42 remainder 0
42/2 3 2l remainder O
21/2 =l0 remainderl
1Ol2 =5 remainder 0
Sl2=2 remainderl
22 lremainder O
I/2 = 0 remainderl

Readiag the remainders from bottom to top, a1340)=

3 19984O)
1998/2=999 remainder 0
999/2- y99 remainderl
4992=249 remainderlL
249/2al24remainderl

b2l2-3Lremainder O
31/2=1Sremainder
lblo28)
bottom
to remainders
from thReading
e
remainder /8=0
remaindero l4/8l
remainderb ly 1g/=8
remainder q4S/8=
l8
remainder2 g45 1sa2/8=
toDcta: 756200) a
indicated bases
imalnumbers
the to following Convert
the 34
noOo(2)
top, bottom
to remainders
from Reading
the
remainderl 0=
I/2
remainderl 3/2=l
12:3remainderl
7remainderl 1S72=
236ATI0074
RiyRathod
a
Rathod Riya
236ATl0074

b. 19380) to hexadecimall
1938/6 a12l remainder 2
121A6 lremainder 9

Reading the remainders from bottom to top, 19384O)


7920a)

c 70to hinanyi
17S/2= 87 remainder l
87/2 =H3 remaiaderl
43/2= 2lremainder l
21/2=l0 remaiaderl
1Ol2=Sremainder )
Sl2=2 remainderl
22lremainder0
Il2=0 remainderl

Leeading the remainders from bottom totop, 540)=


Rathod Riya
23BATO074

3-5. Conrert the hexadecimal nymber (3A7C2 to


binary and octal

I Convert (3A7C2 to binary


Hexadecimal to binary conrersion is straightforward,
as each bhex digit maps to a t-bit binany sequence.
f ll, 3: 0011, A l010, 1=Ql. C=llo0, 2=0010

Combiaing these, we geti

2 Convert F3A7C2 to octal.


We know,

To conrert the binany number

ILoOlolooioo0010(2)to.octal,we group the binany


digitsinsets-of 3,stazting-fromtherightladding
leadingzeros if necessary)

Converting-each-group-of-3-binandigits-to
Rathod Riya
23BAIl0074

octal:
(2)=7(3),100(2)=4(8), 1(2)= 1/8), Olo(2)= 2(8);
OI(2)= 3(8), 1(2): 1(8); 000(2)= 0/8); Ol0(2)= 2(8)
Combining these, we geti
lOONOL0O00010 (2)= 74723102 (3)
So, F3A7C20a)= 74123102(8)
3-la) Gixen the quadratic equation -0x+3l=0 with.
solutions S and 8, we need to determine the radix r of
the numbers.

First,let'swrite the quadratic equationin its factored


form basedon its roatslk 5) )=0Expanding
this, we get

Inadifferent baser, the oriqinalcoe fficients l0 and


3Lmust be interpreted.as base 7numbers. Therefore,
we need the following conditions tohold tue
Lo4zrand 31(e)=3r+l
Rathod Riya
23BATl0074

3-)To obtain the 9's comple ment of an eight-digit


decimal number, you subtract each digit from 9.

123498lo:
9-1=8
9-2:7
9-3za
9-4=5
9-9=0
9-8=l
9-1=2
9-6=3
So, the 9's complement of l239R1eis
81650123.

009801O0:
9-0=9
9-0-9
9-9=0
9-8=l
9-0=8
9-=9
9-0-9
So, the 9'k complement of 00980L00is 99019899.
90009951:
q-9=0
9-0-9
9-0-9
q-0-9
q-9=0
q-9-0

9-l-8
So,the 9scomplement of 9000995is
Rathod Riya
23BAO074

3.12) To obtain the l0's complement of a decimal


number, follew these steps:
Find the 9's complement of the number (subtract each
diqit from 9).
Addlto the result
Here's the calculation for each number

23900:
9's complementi
9-2=1
9-3=b
9-9= 0
9-0=9
9-0-9
So, the 9s complement af 123900is R6099
oscomplement
816099+l=816100

09065
q'scomplement
Rathod Riya
236ATI0074
9-0=9
9-9=0
9-0=9
9-6-3
q-5et
9-7=2
So, the 9's complement of 090loSlis 903342
o's complementi
903342+l=903343

lO0000:
9'scomplementi
9-l=8
q-0=9
9-0=9.
9-0-9
9-0=9
9-0-9.
Rathod Riya
23BATl0074

3-13. Obtain the l's and 2's complements of the


following eight-digit binary numnbers
To find the l's complement, flip each bit(O becomes l
and l becomes O). To find the 2's complement addl to
the l's complement

T's complementi

2's complementi
OLOLOl+l=010LOO0

o000O0

l'scomplement
2'scomplement
OllOtl=QllL
complementi
2's complement:
Ol+=l0000000

00000001:
Iscomplement:
2's complement:
nO=lllllL

O000O000:
Ts complement

2'scomplementi
lll+la00000000

3l4 Toperform the subtroaction of unsiqned decimal


numberssing the l0s complement method, follow
these steps
Eindthe l0'scomplement of thesubtrahend
Addthe 0'scomplement ofthe subtrahend to the
-minuend

Ifthere-is-a-camyout-of the-most-significant digit


Rathod Riya
23BATO014

discard it.
The result is the final answer.

a. 5250 -1321
Eind the l0's complement of 1321:
9999-1321=8%78
8678+1=8619
Add tothe minuend (S250):
S250+8l%79=13929.
Adjust for orerflowa
Since 13929 is aS-digit number and we are dealing
With H-digit numbers, the overflou is the thousands
place xalue:
3929=l0000=3929.

S250-1321=3929

Eind the l0'scomplementaf 8HO


9999-86y0-1359
359+1=l360
Addtothemiawend
0753):
1753+13lo0=3113
Adjust for overflow:
The result fits within 4 digits, so no oadjustment is
needed.
So,
1753-80=313.
c 20- 00
Eind the l0's complement of l00:
999-\00=899
899+1=900
Add to the miauend (20):
20+900=920
Adjust for overflol:
Since the result is 3digits andwe are working with 3
digit_numbers, the overflou is the hundzeds placealue
920-1O00=-8O
20-100=-80

d. 1200250
Eind thel0'scomplement af 250.
q99-2SO-149
T49+la1S0
Addtothe-miavend
Rathod Riya
23BAII0074

0200):
1200+1s0 1950

1200-250=95O.

3-15. Perform the subtraction with the following


wnsigned binany numbers by taking the 2'k complement
of the subtrahend
a llOl0-\0000
I 2's complement ofl00002:
OlOO00
2.Add:

Result: O0000

b llO0-ll0L
2scomplementof llO12
2-Add: 0010+l 00l.
Resut: 0O
Rathod Riya
236ATIO074

2. Add:
OOll+l=01000
Result: O10100which is 20 in decimal)

d. 1O10100(2)-101OL00(2)
L 2'% complement of lO1O1002:
2 Add:
1OO00+O1ONO0=0000000
Result: 00000002

3lo Perform thearthmetic operations using signed.


2'scomplement
L Convert numbers to Bebit binanyi
42-001OLOL02
13ll002(2'scomplement of 00001OL2)
42.lO10l02 (2'scomplementof 00101OL02)
2-0peration 42)+13):
Result O000010l2 Awhich-is
Rathod Riya
23BAlO074

3. Operation (42)-L13):
IlO1ONO+llOOlall00\00)
Result:lloo1001(2) which is -oS10)

3-17 Perform the arithme tic operations With siqned


2's complement representations
For 8-bit representationi
Conver numbers to Robit binany:
70: Ol00010
80: Ql0LO000
-10. 101OLO(2'scomplementof Ol000l02)
-80. 1010I(2's complement of OlO100002)
20peration (10) + (80):
OL00Ol0+O101O000-10OLOe
ResultlOO10O

Lasttwocarrieslleamout,o fnot cariedintothe


-most signiticant
bit)

The overflow indicates that the result is not in the


correct range for an 8-bit signed integer. The last two
carries are unequal, and there's a siqn reversal since
the result l0010l0 indicates a negative number.
3Operation (70)+-80):
LOO+1O10=Qll0100L
Result: ONO2)

Last two carries:lL(carmout), L(carriedinto the most


significant bit)

The resul+ QllOlOO12 representsloSi0, which is


Lincorrec for adding two negative numbers The last
tulocaies are equal, and there'sasign rerersal,
indicating that the resutis not correct

3e18. Perform the arthmetic operations with decimal


mumbers-using-signed-l0'scomplementrepresentation
For 4-digit decimalrepresentationi
I Convert-numbers to tedigit-signedl0's complement
-638.9999-0638 -936l 40's-complementof Olo38,-plus
1: 936)
785: 0785
-638-185:
185: O135
185: 9999-0185= 9814
00'% complement of O185,plus l: 9814)
2. Operoation a. (638)+(185):
93ol+0185=\0]Ha
LAdjust for H-digit orerfloi:
LOHo-lO000=0lHo
Result: OlHalo)

3 Operation b (a38) - 085)


93ol+98l4=19175
Adjust for 4edigit oxerflow:
9115-l0000-9ls
Resut: 91s40)

You might also like