0% found this document useful (0 votes)
25 views3 pages

Ca2324 hw1 Questions

questions 1 for computer science

Uploaded by

Kareem Mohamed
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)
25 views3 pages

Ca2324 hw1 Questions

questions 1 for computer science

Uploaded by

Kareem Mohamed
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/ 3

Computer Architecture Homework 1

Deadline: November 27, 2023 at 23:59

Note: You are required to use the LATEX template provided on Brightspace.

Question 1 (4 points)
Convert the following decimal numbers to their 2’s complement representations (use 8 bits for each
number and truncate the fractional digits if necessary):
a) 102.3
b) 6.3
c) −13
d) 0.04

Question 2 (6 points)
Perform the following operation in 2’s complement. Indicate when an overflow happens.
a) 11001010 + 11101010
b) 01011010 + 00110101
c) 0011.1100 + 0100.0100
d) 11010111 − 00001011

Question 3 (10 points)


Write IEEE floating point representation of the following decimal numbers.
a) 19.45
b) −0.028

Question 4 (10 points)


The following numbers are in IEEE floating point representation. Write their decimal equivalents.
a) 10111100 11010101 11100000 00000000
b) 00000000 00000100 00000000 00000000

1
Computer Architecture Homework 1

Question 5 (10 points)


Assume we are considering a set of symbols consisting of the capital English letters (26 letters) plus
white-space, question mark, and full stop to communicate messages. In our coding list, the letters
of the alphabet precede white-space, question mark and full stop in this representation.
a) How many bits do we need to encode each symbol in this set?
b) Assume 32-bit words are used for communicating messages. Furthermore, assume the charac-
ter codes cannot span over multiple words. Show how the following message is encoded, and
what will be its equivalence in hexadecimal.
THIS IS A SAMPLE STRING. OR IS IT?

Question 6 (10 points)


Consider the following circuit, depicted in Figure 1. What is its output for the following inputs?
a) a1 a2 = 10, b1 b2 = 11
b) a1 a2 = 01, b1 b2 = 00
Moreover, what does the circuit do?

Figure 1

Question 7 (10 points)


Design a combinational logic circuit to compare two 2-bit numbers. The output should be 0 if the
numbers are not equal, and 1 if they are equal.

2
Computer Architecture Homework 1

Question 8 (10 points)


Using a decoder and an encoder design a circular incrementor circuit for 4-bit positive binary
numbers. The input (a number between 0 and 7) will be incremented by one if its is less than 7. If
the input is 7, the output should be zero.

Question 9 (15 points)


We want to design a circuit to detect if an 8-bit positive binary number is divisible by 5 or not.
Use a multiplexer and any necessary logic gates to design your circuit. Justify your solution.

Question 10 (15 points)


Adding two numbers represented in scientific notation requires shifting floating points to make
exponents equal before adding the fractions. Consider the following example:

1.34 · 103 + 2.1 · 10−1

First, shift the decimal point of the smaller number to equalize the exponents:

1.34 · 103 + 0.00021 · 103

Then add the fractions, and normalize the result if necessary.

1.34021 · 103

Follow the procedure described above to add the following numbers:

N = 14.25, M = 0.5

a) Convert the numbers to IEEE floating point format.


b) Add the numbers.
c) Normalize the result to put it in IEEE format again.

You might also like