Lab 1,2 - WordPress.com

Download Report

Transcript Lab 1,2 - WordPress.com

Digital Logic Design
1
Lab 1,2
By Nora Alaqeel
Exercises
2
Q 1.3 Convert the following numbers with the
indicated bases to decimal:
(b) (735)8
(735)8 = 7 * 82 + 3 * 81 + 5 * 80 = 47710
By Nora Alaqeel
Exercises
3
Q 1.4 What is the largest binary number that can be
expressed with 14 bits? What are the equivalent
decimal and hexadecimal numbers?
14-bit binary: 11 1111 1111 1111
Decimal: 16,38310
Hexadecimal: 3FFF16
By Nora Alaqeel
Exercises
4
Q 1.5 Determine the base of the numbers in each case
for the following operations to be correct:
(a) 14 / 2 = 5
Let b = base
14/2 = (b+4) / 2 = 5, So b=6
By Nora Alaqeel
Exercises
5
Q 1.9 Express the following numbers in decimal:
(a) (10110.0101)2
(b) (26.24)8
(a) (10110.0101)2= 16 + 4 + 2 + 0.25 + 0.0625 = 22.3125
(b) (26.24)8 = 2*8 + 6 + 2/8 + 4/64 = 22.3125
By Nora Alaqeel
Exercises
6
Q 1.12 Add and Multiply the following numbers
without converting them to decimal:
(a) Binary numbers 1011 and 101.
By Nora Alaqeel
Exercises
7
(a) Binary numbers 1011 and 101.
Add:
By Nora Alaqeel
Multiply:
Exercises
8
Q 1.13 Do the following conversion problems:
(b) Calculate the binary equivalent of 2/3 out of 8
places. Then convert from binary to decimal. How
close is the result to 2/3 ?
2/3 = .6666666667
• Convert from decimal to binary.
• Convert from binary to decimal.
• Compare results.
By Nora Alaqeel
Exercises
9
 Convert from decimal to binary.
(.6666666667)10 = (.10101010)2
By Nora Alaqeel
Exercises
10
• Convert from binary to decimal.
.10101010 =
(1*2-1) + (1*2-3) + (1*2-5) + (1*2-7)=
(1/21) + (1/23) + (1/25) + (1/27) =
(1/2) + (1/8) + (1/32) + (1/128) =
0.5 + 0.125 + 0.03125 + 0.0078125 = 0.6641
By Nora Alaqeel
Exercises
11
Q 1.14 Obtain the 1’s and 2’s complements of the
following binary numbers:
(a) 10000000
1’s comp: 01111111
2’s comp: 10000000
By Nora Alaqeel
Exercises
12
Q 1.15 find the 9’s and 10’s complements of the
following decimal numbers:
(a) 52,784,630
9’s comp: 47,215,369
10’s comp: 47,215,370
By Nora Alaqeel
Exercises
13
Q 1.16 Find the 16’s complements of B2FA
15’s comp: 4D05
16’s comp: 4D06
By Nora Alaqeel
Exercises
14
Q 1.17 Perform subtraction on the given unsigned
numbers using the 10’s complements of the
subtrahend. Where the result should be negative.
(a) 6428 - 3409
3409 -> 6590 (9’s comp) -> 6591 (10s comp)
6428 – 3409 = 6428 + 6591 = 3019
By Nora Alaqeel
Exercises
15
Q 1.19 the following decimal numbers are shown in
sign-magnitude form: +9,286 and +801. Convert
them to signed-10’s complement form and perform
the following operations (note that the sum is
+10,627 and requires five digits and sign).
(c) (-9286) + (+801)
+9286 -> 009286; +801 -> 000801
-9286 -> 990714; -801 -> 999199
(c) (-9286) + (+801) = 990714 + 00801 = 991515
By Nora Alaqeel
Exercises
16
Q 1.22 Convert decimal 8,723 to BCD.
8,723
BCD: 1000 0111 0010 0011
By Nora Alaqeel
Exercises
17
Q 1.23 Represent the unsigned decimal numbers 842
and 537 in BCD, and show the steps necessary to
form their sum.
Invalid
BCD code
By Nora Alaqeel
18
 Q 1.25 Represent the decimal number 5137 in
 BCD:
0101 0001 0011 0111
 Excess-3:
By Nora Alaqeel
1000 0100 0110 1010
Exercises
19
Q 1.28 Write the expression “G. Boole” in ASCII,
using an eight-bit cod. Include the period and the
space. Treat the leftmost bit of each character as a
parity bit. Each eight-bit code should have even
parity.
G
(dot)
(space)
B
01000111
00100111
10100000
0100001
0
By Nora Alaqeel
o
01101111
o
01101111
l
e
01101100
01100101
Exercises
20
Q 1.29 Decode the following ASCII code:
1000010 1101001 1101100 1101100 1000111 1100001
1110100 1100101 1110011
Bill Gates
By Nora Alaqeel
Exercises
21
Q 1.34 List the ASCII code for the 10 decimal digits
with the odd parity bit in the leftmost position.
By Nora Alaqeel