Vous êtes sur la page 1sur 5

Digital Circuits and Systems Lab

Assignment 1
Assignment released on: 6th September 2017
Submission Deadline: 16th September 2017

Instructions:

1. This assignment contains 5 pages and 12 questions.

2. Total of marks are 60.

3. In each code, first input variable name should include your roll number.

4. For each questions, you have to write the corresponding VHDL, put the screen-shot
of schematic diagram, simulation result and write the value of Power Usage and LUT
usage.

1. (5 points) Write a VHDL program to calculate the switching activity in a 16 bit bus.
Switching activity is count of the number of bit changes on consecutive bit moving from
LSB to MSB. Take a 16 bit array, input bus, for input port and output should be
stored in an integer no of activities. Your simulation results should clearly show 16
bit input and the corresponding integer output.

2. (5 points) Consider the Thermometer to Gray code converter given in Figure 1.


Implement the above encoder using structural architecture by using 15 bit array (T) as
input and 4 bit array G as output. Your simulation results should show the outputs for
the following values of T:

1. 000000000001111
2. 000000000011111
3. 111111111111111

3. (5 points) Consider the architecture of 4 bit Carry Look ahead adder given in Figure 2.

Implement the above adder using dataflow architecture by using two 4 bit arrays (A and
B), Co as input and 4 bit array S as output. Use Cout to show the output carry. Your
simulation results should show the outputs for the following values of A and B and C0.:
DCS Lab Assignment -1 - Page 2 of 5 6th September 2017

Figure 1: MUX based tree encoder

Figure 2: Carry Look ahead Adder


DCS Lab Assignment -1 - Page 3 of 5 6th September 2017

1. A = 0011, B = 1010, C0 = 1;
2. A = 1100, B = 0011, C0 = 0;
3. A = 0111, B = 1000, C0 = 1;
4. (5 points) Consider the architecture of 4 bit array multiplier given in Figure 3.

Figure 3: Carry Look ahead Adder

Implement the above encoder using structural architecture by using two 4 bit arrays (A
and B), as inputs and 8 bit array P as output. Your simulation results should show the
outputs for the following values of A and B:
1. A = 0011, B = 1010
2. A = 1100, B = 0011
3. A = 0111, B = 1000
5. (5 points) Write a VHDL code that counts the number of 1 in a 32 bit vector. Your
input should be a 32 bit vector I and output should be shown by an integer O. In the
simulation results, show your outputs for 4 different values of I.
6. (5 points) Figure 4 shows the top-level diagram of a 4-bit adder. The circuit has two
inputs ( a, b) and one output (sum). Write down the two different VHDL codes and
simulate for the following cases:
1. All signals are of type signed.
2. The output is of type Integer and inputs remain signed.

7. (5 points) Figure 5 shows a 4-input, one bit per input multiplexer. The output must
be equal to the input selected by the selection bits, s1-s0. Implement and confirm the
functionality of it for the following two cases:
DCS Lab Assignment -1 - Page 4 of 5 6th September 2017

Figure 4: 4 Bit Adder

1. Using WHEN/ELSE (simple WHEN)


2. With WITH/SELECT/WHEN (selected WHEN)

Figure 5: 4 Input Mux

8. (5 points) Figure 6 shows as 8-bit unsigned carry ripple adder. The top-level diagram
shows the inputs and outputs of the circuit: a and b are the input vectors to be added,
cin is the carry-in bit, s is the sum vector, and cout is the carry-out bit. The one-level-
below-top diagram shows how the carry bits propagate (ripple).
Each section of the latter diagram is a full-adder unit. Thus its outputs can be computed
by means of equations mentioned in the figure.

Implement this ripple carry adder and confirm the results with the simulation for the
following:

1. Data type to be used is of INTEGERS and implement using IF.


DCS Lab Assignment -1 - Page 5 of 5 6th September 2017

Figure 6: 8 Bit Adder

9. (5 points) A BCD code is being transmitted to a remote receiver. The bits are x3 , x2 , x1
and x0 with x3 as MSB. The receiver includes a BCD error detector circuit that examines
the received code to see if it is a large BCD code (i.e greater than 1001). Design this
circuit to produce logic HIGH for any error detection using VHDL. Show your simulation
results for the followings input values: 1000, 1100, 0011, 1100

10. (5 points) Four large tanks at a chemical plant contain different liquids being heated.
Liquid level sensors are being used to detect whenever the level in the tank A or tank B
rises above a predetermined level. Temperature sensors in tanks C and D detect when the
temperature in either of these tanks drops below prescribed temperature limit. Assume
that the liquid level sensor output A and B are LOW when the level is satisfactory and
HIGH when the level is too high. Also the temperature sensor outputs C and D and
LOW when the temperature is satisfactory and HIGH when the temperature is too low.
Design a logic circuit using VHDL that will detect whenever the level in the tank A or
tank B is too high at the same time that temperature in either tank C or tank D is too
low.

11. (5 points) write a VHDL code to generate a hamming code (error detection code) for
any 4 bit binary number.

12. (5 points) Implement following boolean expression using minimum number of 2:1 mul-
tiplexers (only) - Use structural coding
Y = (AB + ABC + D)E

Vous aimerez peut-être aussi