You are on page 1of 4

Habib University

Course Title: Digital Logic and Design (EE-172 / CS-130 / CE-222)

Instructors: Farhan Khan, Syed Muhammad Hur Rizvi, Ahmed Ali

Assignment No. 01
st
Release Date: September 1 , 2023 Due by: September 08th, 2023 11:59 PM

Total points: 100 Points obtained:

Student Name: Student ID: Section:

Purpose:
The purpose of this assignment is to help you practice the number representation; its conversion; and the
arithmetic operations in different base formats. In addition, this assignment will aid you to understand the
process of representing a signed number in different formats; representing complements of a number; and
performing BCD arithmetic.
Instructions:
1. This assignment should be done individually.
2. All questions should be answered in black ink only. (Extra sheets can be used)
3. Scan your answer sheet and upload it on LMS before the due date.
Grading Criteria:
1. Your assignments will be checked by instructor/TA.
2. You can also be asked to give a viva where you will be judged whether you understood the
question yourself or not. If you are unable to correctly answer the question you have
attempted right, you may lose your marks.
3. Zero will be given if the assignment is found to be plagiarized.
4. Untidy work will result in a reduction of your points.
Late submission penalty:
 1-day late submission – 20% deduction of the maximum allowable marks
 2-days late submission – 40% deduction of the maximum allowable marks
 No submission will be accepted after two days of the original deadline
CLO Assessment:
This assignment assesses students for the following course learning outcomes.

CLO
Course Learning Outcomes
Assessed
CLO 1 Apply r-base (binary, octal, decimal, hexadecimal numbers systems) to digital
systems and carry out arithmetic operations and conversions
CLO 2 Apply principles of Boolean Algebra to represent and build equivalent
realizations of digital logic (circuits)
CLO 3 Design combinational logic circuits using logic gates
CLO 4 Design sequential systems using finite state machine methodology
P# Questions Pts
1 Convert the following numbers with the indicated bases to decimal: 2x4
a) (71.77)8
b) (212)3
c) (56A)11
d) (0.531)6
2 Convert the following numbers 2x4
a) (567.34)10 to binary
b) (30.21)4 to octal
c) (1.123)8 to hexadecimal
d) (110110.011)2 to base-9
3 A 12-bit register stores 100100100101. Determine what value is stored in decimal 2x4
in the register if the bits represent:
a) Unsigned number
b) Signed number (2’s complement system)
c) Signed number (1’s complement system)
d) BCD
4 Suppose that you are in a cybersecurity team in a company which is ready to launch 4+2+2
their best product lineup, but they must keep the year of release a secret, so you are
given a task to create a system to tell the year that only your company’s employees
are able to decode. You are required to use all the following characters only (no
other characters are allowed):

( ) [ ] { } / \

a) Create a suitable number system and fill in the following table up to 12.
State your assumptions clearly.

Actual 0 1 2 3 4 5 6 7 8 9 10 11 12 …
Coded …

b) Represent the year 202610 in your coded notation


c) In your number system, what does “{(\)}” represent in decimal?

5 You are a researcher and you and your team are researching some creatures living 6
in the heart of the Changa Manga forest. You don’t know much about these
creatures, the only clue you have is this equation that your team found written on a
tree in the forest.
(41 ⋅ 21) + 5 = 1310
If this equation is correct, how many fingers would you expect the creatures have?
(Hint: Early humans learned counting to 10 using their fingers)
6 Suppose you are working in a startup which makes apps, but the problem is that 4
their processing speed is very low, your task is to optimize the process:
The decimal number 789 had to be converted into binary to feed into the computer
and you have the following two ways:
 Convert directly to binary
 Convert first to hexadecimal and then from hexadecimal to binary.
Which method is faster? Justify your answer with reasoning.

(Requirement: You must show the working of both the parts and then give your
reasoning based on time and method used. Marks will only be awarded if you can
justify your answer).

7 In the futuristic world of robots, they use a base-18 number system for their energy 2+5+3
charging transactions, extending the digit representation employed in the
hexadecimal system.
a) Imagine Robot A lending Robot B (1A3CH)18 units of energy, with the
condition that B returns the energy within 4 charging cycles. If B manages
to return the energy within this 4-cycle period, there is no additional cost.
However, if B fails to return the energy within 4 cycles, an additional
charge of (5B3E)18 units of energy applies for each charging cycle beyond
the initial 4.
b) Calculate the total amount of energy B must return if he returns it 8
charging cycles after initially borrowing it.
c) Additionally, determine the net gain or loss in energy for Robot A in the
conventional base-10 (decimal) number system.
8 Convert the last three alphabets of your first name and the first three alphabets of 2x2+4
your last name to hexadecimal system, according to the given table.
A B C D E F G H I J K L M
41 42 43 44 45 46 47 48 49 4A 4B 4C 4D

N O P Q R S T U V W X Y Z
4E 4F 50 51 52 53 54 55 56 57 58 59 5A

For example, your name is “HASSAN ALI,” you will convert “SAN” from Hassan
and “ALI” from ALI as follows. (Use uppercase letters)
“SAN”  53414E
“ALI”  414C49
(Let the first number be X1 and the last name be X2)
a) Using 16’s Complement method, perform the following: X1 - X2
b) Using 15’s Complement method, perform the following: X2 – X1
c) Convert both X1 and X2 to radix 8 and find their sum
9 Using the r’s complement method, where r is the radix of the numbers mentioned, 3x2
find the following differences:
a) (6421)8 - (2374)8
b) (1100.101)2 - (0111.001)2
10 Convert the following decimal numbers to BCD to solve: 2x4
a) 376 + 189
b) 524 – 237
c) 98 + 6.5
d) 0.721 + 1.48
11 Convert the following to signed (2’s Complement) 6-bit binary numbers and 2x4
perform the given operations. Also mention if there is an overflow or not.
a) (-15)10 + (+5)10
b) (-7)10 – (+7)10
c) (+20)10 + (+10)10
d) (-24)10 + (-11)10
12 What is the smallest binary integer that can be expressed with a 16-bit computer 2x3
using 2’s complement signed representation? What are the equivalent decimal and
hexadecimal numbers?
13 Complete the following table using 8-bit binary numbers: 1x6
Signed 1’s Signed 2’s
Decimal Signed Magnitude
Complement Complement
-10
-128
-32
+64
+127
+0
14 Find out the even parity bit of the following binary numbers: 1x2
I. 01010110
II. 10110101
15 Convert any ONE of the following: 4
a) BCD number 0110100101110001 to excess-3
b) Binary 1100100111100101 to Gray Code

You might also like