0% found this document useful (0 votes)
19 views2 pages

Assignment 1 2

Uploaded by

mekh2152
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)
19 views2 pages

Assignment 1 2

Uploaded by

mekh2152
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/ 2

Michael Mounir Melad 202200467

Assignment 1

1- Represent the unsigned decimal numbers 791 and 658 in BCD, and then show the steps necessary to form
their sum

791 -> 011110010001BCD 658 -> 011001011000BCD

0111100100012 + 0110010110002 = 1101111010012

2- Obtain the 1’s and 2’s complements of the following binary numbers:

(a) 00010000 (b) 00000000

1's = 111011112 1's = 111111112

2's = 111100002 2's = 1000000002

(c) 11011010 (d) 10101010

1's = 001001012 1's = 010101012

2's = 001001102 2's = 010101102

3- Do the following conversion problems:


(a) Convert decimal 27.3125 to binary.
(11011.01010)2
(b) Calculate the binary equivalent of 2/3 out to eight places.
Then convert from binary to decimal.

0.66666666×2=1.33333333 -> 1
0.33333333×2=0.66666666 -> 0
0.66666666×2=1.33333333 -> 1
0.33333333×2=0.66666666 -> 0
0.66666666×2=1.33333333 -> 1
0.33333333×2=0.66666666 -> 0
0.66666666×2=1.33333333 -> 1
0.33333333×2=0.66666666 -> 0
Binary of 2/3 = 0.10101010...

(c) Convert the binary result in (b) into hexadecimal.


Then convert the result to decimal. Is the answer the same?

(0.10101010...)2 = (0.AA...)16
0.AA... -> decimal :
0.(10) x 16-1 + (10) x 16-2 …
= 0.(0.625 + 0.03960625)10
= 0.664062510
Michael Mounir Melad 202200467
4- Subtract
1- 1012 - 10012
We take 2's complement of subtrahend 1001, which is 0111.
Now, sum them. So,
101 + 111 = 11002

2- 1100102 – 1001012
11012
5- ADD
1- 101101 + 11001
10001102
2- 1011001 + 111010
100100112
3- 10111 + 110101
10011002
6- Consider two binary numbers, B = 0110102 and C = 01012 where we want to divide B by C.
1012
7- We can perform logical operations on strings of bits by considering each pair of corresponding bits
separately (called bitwise operation). Given two eight-bit strings A = 10110001 and B = 10101100, evaluate
the eight-bit result after the following logical operations:

(a) AND
(b) OR
(c) XOR
(d) NOT A
(e) NOT B
(f) NOR
AND OR XOR

10110001 10110001 10110001


10101100 10101100 10101100
10100000 10111101 00011101

NOT A NOT B NOR

10110001 10101100 10110001


01001110 01010011 10101100
01000010
8- Implement the Boolean function
F = xy + x’y’ + y’z
(a) With AND, OR, and inverter gates (b) * With OR and inverter gates

(c) With AND and inverter gates (d) With NAND and inverter gates

You might also like