0% found this document useful (0 votes)
7 views9 pages

Ca2324 hw2 Template

Question 4 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)
7 views9 pages

Ca2324 hw2 Template

Question 4 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/ 9

Computer Architecture Homework 2

Question 1 (10 points)


Design an FSM for a music player with four buttons: stop, play, fast forward, and pause.
ˆ The music player stops playing as soon as the stop button is pressed regardless of whether it
is paused, playing or fast forwarding;
ˆ the fast forward button can be used only when the player has been stopped;
ˆ pause has no effect when the player is stopped or is fast forwarding;
ˆ play button can be used when the player is paused or stopped.
Draw the FSM diagram and show the transitions.

Solution:

Question 2 (15 points)


Assume a combinational logic circuit includes 3 outputs. Using logic gates design a circuit to
determine if the majority of the outputs are 1 or 0.
Example:
Majority 1: 101, 110
Majority 0: 000, 001
Figure ?? depicts the diagram of the circuits. The output from the majority detector is 1, if at
least 2 of its inputs are 1, and zero otherwise.

1
Computer Architecture Homework 2

Figure 1

Solution:

2
Computer Architecture Homework 2

Question 3 (10 points)


Assume a circuit has 8 inputs and we want to select one input at a time. Design an 8-to-1 multiplexer
for this application using two 4-to-1 multiplexers and one 2-to-1 multiplexer. Complete the solution
shown below in Figure ?? by determining the select inputs of the multiplexers.

Figure 2

3
Computer Architecture Homework 2

Solution:

Question 4 (5 points)
The addressability of memory system of a computer is two bytes. You need 18 bits to access a
location in memory. What is the total size of the memory in bytes?

Solution:

The adressability of the memory is 2 bytes, which also mean that each memory location can
store 2 bytes of data. And to calculate the total size of the memory the following equation can
be used: Total Size of Memory = Number of Addresses × Size of each Addressable Unit
Total Size of Memory = 218 × 2
Total Size of Memory = 219
so the total size of the memory in bytes is 219 bytes

Question 5 (15 points)


Even parity is a method of error checking used in digital communication. In the context of parity
bits, ”even parity” refers to the parity bit being 1 or 0 in a way that the total number of “1” bits
(including the parity bit) is an even number.
Assume data is 8 bits. Design a combinational logic circuit to generate the even parity bit for the
data.

4
Computer Architecture Homework 2

Solution:

The concept of even parity involves the addition of a parity bit to a set of data bits to ensure
that the total number of ”1” bits, including the parity bit, is always even. In the case of even
parity, if the original data contains an odd number of ”1” bits, an additional ”1” is added as
the parity bit to maintain an even count. Conversely, if the data already has an even number
of ”1” bits, no extra bit is added. The XOR (exclusive OR) gate is a logical gate that aligns
with this specification, making it a suitable for implementing the even parity.

F represents the even parity bit

Question 6 (10 points)


In the shift register in Figure ??, select bits of the multiplexers determine the operation. The
register can preserve the current value, shift left with serial input from the least significant bit,
shift right with serial input from the most significant bit, and parallel input. Modify the circuit to
perform circular shifts instead of serial input shifts. In a left circular shift the most significant bit
is placed at the least significant bit position. In a similar way, a right circular shift moves the least
significant bit to the most significant bit position.
Example:
Current value: 0011
After left circular shift: 0110
After right circular shift: 1001

5
Computer Architecture Homework 2

Figure 3

Solution:

Question 7 (15 points)


Figure ?? depicts a combinational logic circuit of a 2-to-4 decoder (two inputs A1 and A0 and 22
outputs F3 F2 F1 F0 ) with an enable input signal E.

6
Computer Architecture Homework 2

Figure 4

a) Fill all of the missing values in the following truth table and provide the steps you followed to
obtain your answers. Please note that symbol X in the table can represent both 0 or 1 (the
so-called “don’t care”).

E A1 A0 F3 F2 F1 F0
1 X X
0 0 0
0 0 1
0 1 0
0 1 1

b) How many 2-to-4 decoders are needed to design a 4-to-16 decoder? Explain your answer.

Solution:

Question 8 (10 points)


The circuit in Figure ?? receives two 4-bit binary numbers (2’s complement). The output of the
circuit is 1 if the numbers are equal and 0 otherwise. Design the circuit using logic gates.

7
Computer Architecture Homework 2

Figure 5

Solution:

Question 9 (10 points)


The memory depicted in Figure ?? contains 1024 memory locations.

Figure 6

a) To increase the capacity of the memory to 2048, two circuits of 1024 locations are used. How
many bits are needed to address each location after this extension?

8
Computer Architecture Homework 2

b) How should we connect the address/data/WE buses to these memory units? (Draw your
solution)

Solution:

You might also like