Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Total marks = 20

Digital Logic Design (CS302)


Assignment # 01 30 November 2020
Fall 2020

Please carefully read the following instructions before attempting the assignment.

RULES FOR MARKING


It should be clear that your assignment would not get any credit if:
 The assignment is submitted after the due date.
 The submitted assignment does not open or the file is corrupt.
 Strict action will be taken if the submitted solution is copied from any other
student or the internet.

You should consult the recommended books to clarify your concepts as handouts are not
sufficient.

You are supposed to submit your assignment in Doc or Docx format.


Any other formats like scan images, PDF, ZIP, RAR, PPT, and BMP, etc. will not be accepted.

Topic Covered:
 Number Systems
 Logic Gates
 Boolean Algebra

Lecture # 01 till Lecture # 09

NOTE

No assignment will be accepted after the due date via email in any case (whether it is the
case of load shedding or internet malfunctioning etc.). Hence refrain from uploading
assignments in the last hour of the deadline. It is recommended to upload the solution file
at least two days before its closing date.

If you people find any mistake or confusion in the assignment (Question statement),
please consult with your instructor before the deadline. After the deadline, no queries
will be entertained in this regard.

For any query, feel free to email at:


cs302@vu.edu.pk
Question No 01 Marks (10)

Perform the following arithmetic operations on the 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 )O−( 1011010101010101011101 )B + ( ↑ ∆> ΣΩ )5−( 9877693 ) D

You must show all the steps of calculations and conversions involved. In the case of direct
results, major marks will be deducted.
Hint: Convert all numbers to Decimal Number System and then reconvert it to Caveman Number
System.
Solution
We are required to use the Indirect Method or Repeated Division methods only.

 ( 6 F 4 DE 2 ) H =( 0110 1111 0100 1101 11100010 )2


(11011110100110111100010)₂ = (1 × 2²²) + (1 × 2²¹) + (0 × 2²⁰) + (1 × 2¹⁹) + (1 × 2¹⁸)
+ (1 × 2¹⁷) + (1 × 2¹⁶) + (0 × 2¹⁵) + (1 × 2¹⁴) + (0 × 2¹³) + (0 × 2¹²) + (1 × 2¹¹) + (1 × 2¹⁰)
+ (0 × 2⁹) + (1 × 2⁸) + (1 × 2⁷) + (1 × 2⁶) + (1 × 2⁵) + (0 × 2⁴) + (0 × 2³) + (0 × 2²) + (1
× 2¹) + (0 × 2⁰)
Hence ( 6 F 4 DE 2 ) H =( 01101111 0100 1101 11100010 )2=( 7294434 )10

 ( 3476423 )O =¿
(11100111110100010011)₂ = (1 × 2¹⁹) + (1 × 2¹⁸) + (1 × 2¹⁷) + (0 × 2¹⁶) + (0 × 2¹⁵) +
(1 × 2¹⁴) + (1 × 2¹³) + (1 × 2¹²) + (1 × 2¹¹) + (1 × 2¹⁰) + (0 × 2⁹) + (1 × 2⁸) + (0 × 2⁷) +
(0 × 2⁶) + (0 × 2⁵) + (1 × 2⁴) + (0 × 2³) + (0 × 2²) + (1 × 2¹) + (1 × 2⁰) = (949523)₁₀
Hence
( 3476423 )O =¿

 ( 1011010101010101011101 )B = (1 × 2²¹) + (0 × 2²⁰) + (1 × 2¹⁹) + (1 × 2¹⁸) + (0 × 2¹⁷) +


(1 × 2¹⁶) + (0 × 2¹⁵) + (1 × 2¹⁴) + (0 × 2¹³) + (1 × 2¹²) + (0 × 2¹¹) + (1 × 2¹⁰) + (0 × 2⁹) +
(1 × 2⁸) + (0 × 2⁷) + (1 × 2⁶) + (0 × 2⁵) + (1 × 2⁴) + (1 × 2³) + (1 × 2²) + (0 × 2¹) + (1 ×
2⁰) = (2970973)₁₀
Hence
( 1011010101010101011101 )B=¿


( ↑ ∆> ΣΩ )5 =( ↑ x 54 ) + ( ∆ x 53 ) + ( ¿ x 52 ) + ( Σ x 51 ) + ( Ω x 5 0 )=( 4 x 5 4 ) + ( 1 x 53 ) + ( 2 x 52 ) + ( 0 x 51 ) + ( 3 x 50 )= ( 4 x 625 )+ ( 1
Hence
( ↑ ∆> ΣΩ )5 =( 2678 )10
So finally,
( 6 F 4 DE 2 ) H + ( 3476423 )O−( 1011010101010101011101 )B + ( ↑ ∆> ΣΩ )5−( 9877693 ) D

( 7294434 )10 + ( 949523 )10−¿


Now, in the last step, we need to convert the resultant Decimal Number into a Caveman Number.
But as you see we had a negative Decimal Number and there is no representation of a Negative
Number in the Caveman Number System. So, we will ignore the negative sign and convert the
result into Caveman Number.
( 7294434 )10 + ( 949523 )10−¿

5 460203
1
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 = >∆

( 4602031 )10=( ¿ ∆ Ω↑>Ω ∆ ∆ ∆ ∆ )CAVEMAN

Question No 02 Marks (10)


Perform the following conversions:
 Convert the ( FE 45 EA ) H into the Gray Code.
(FE45EA)16 = (15 × 16⁵) + (14 × 16⁴) + (4 × 16³) + (5 × 16²) + (14 × 16¹) + (10 × 16⁰)
= (15 × 1048576) + (14 × 65536) + (4 × 4096) + (5 × 256) + (14 × 16) + (10 × 1) =
= 15728640 + 917504 + 16384 + 1280 + 224 + 10 = (16664042)10
(FE45EA)16 = (16664042)10

2 16664042
2 8332021 - 0
2 4166010 - 1
2 2083005 - 0
2 1041502 - 1
2 520751 - 0
2 260375 - 1
2 130187 - 1
2 65093 - 1
2 32546 - 1
2 16273 - 0
2 8136 - 1
2 4068 - 0
2 2034 - 0
2 1017 - 0
2 508 - 1
2 254 - 0
2 127 - 0
2 63 - 1
2 31 - 1
2 15 - 1
2 7 - 1
2 3 - 1
2 1 - 1

( FE 45 EA ) H =( 16664042 )10=( 111111100100010111101010 )2

Binary 1 1 1 1 1 1 1 0 0 1 0 0 0 1 0 1 1 1 1 0 1 0 1 0
Number

Gray Code 1 0 0 0 0 0 0 1 0 1 1 0 0 1 1 1 0 0 0 1 1 1 1 1

( 111111100100010111101010 )2= (100000010110011100011111 )¿Code

(100000010110011100011111)₂ = (1 × 2²³) + (0 × 2²²) + (0 × 2²¹) + (0 × 2²⁰) + (0 × 2¹⁹) + (0


× 2¹⁸) + (0 × 2¹⁷) + (1 × 2¹⁶) + (0 × 2¹⁵) + (1 × 2¹⁴) + (1 × 2¹³) + (0 × 2¹²) + (0 × 2¹¹) + (1 ×
2¹⁰) + (1 × 2⁹) + (1 × 2⁸) + (0 × 2⁷) + (0 × 2⁶) + (0 × 2⁵) + (1 × 2⁴) + (1 × 2³) + (1 × 2²) + (1
× 2¹) + (1 × 2⁰) = (8480543)Gray Coded Decimal
( 100000010110011100011111 )¿ Code= ( 8480543 )¿Coded Decimal

1
8480543
6
1
530033 - 15 = F
6
1
33127 - 1
6
1
2070 - 7
6
1
129 - 6
6
1
8 - 1
6
( 8480543 )¿ Coded Decimal =( 81671 F )¿Coded Hex
 Find the equivalent Excess-7 code for the number ( 76372 )O
Excess-7 Number System
For an Excess-N-based number, we need to represent “X” codes for that we will use the binary
code for X+M.
As you already know, Excess-N = (2n-1-1), where n is the number of bits required to represent the
number. For Excess-7 Number System or Representation. We need:
2n−1−1=7
2n−1=7+ 1
2n−1=8
2n−1=2∗2∗2
2n−1=23
n−1=3
n=4
So, we will use 4 bits to represent the number.

VALU
SIGNED MAGNITUDE EXCESS-7
E
-9 ---- ----
-8 ---- ----
-7 1111 0000
-6 1110 0001
-5 1101 0010
-4 1100 0011
-3 1011 0100
-2 1010 0101
-1 1001 0110
0 1000 or 0000 0111
+1 0001 1000
+2 0010 1001
+3 0011 1010
+4 0100 1011
+5 0101 1100
+6 0110 1101
+7 0111 1110
+8 ---- 1111

As for a valid BCD (8421) number, we need to add 6 to make an invalid BCD into a Valid one.
Same as that, we will add 7 (0111) to make an invalid Excess-7 into a valid Excess-7 code.
We can represent numbers from -7 to +8 using an Excess-7 Number System. So, in such case, 9
will be presented as 1 0 = 0001 0000 in Excess-7 format.
Solution
We want to find the equivalent Excess-7 code for the number ( 76372 )O , First, we are required to
convert an Octal Number into a Decimal Number.
(76372)O = (7 × 8⁴) + (6 × 8³) + (3 × 8²) + (7 × 8¹) + (2 × 8⁰) = (31994)10
In term of a 4-bit number, we can rewrite the obtained Decimal Number as:
3 1 9 9 4
NORMAL BINARY CODE 0011 0001 1001 1001 0100
0111 0111 0111 0111 0111
To convert a normal number, we will add 7 (0111) to make it Excess-7 Number
EXCESS-7 NUMBER 1010 1000 0001 0000 0001 0000 1011

You might also like