DDCO QB&Ans @vtudeveloper - in
DDCO QB&Ans @vtudeveloper - in
DDCO QB&Ans @vtudeveloper - in
MODULE 1 & 2
1. Minimize the following boolean function-
F(A, B, C, D) = Σm(0, 1, 2, 5, 7, 8, 9, 10, 13, 15)
Solution:
F(A,B,C)=π(0,3,6,7)
F(A,B,C,D)= π (3,5,7,8,10,11,12,13)
F (P, Q, R) = π (0,3,6,7)
and(y,a,b);
endmodule
assign y = a & b;
endmodule
always @ (a,b)
y = a & b;
endmodule
NOT gate
not(y,a);
endmodule
assign y = ~a;
endmodule
always @ (a)
y = ~a;
endmodule
14. Develop Verilog code for the following combinational logic circuts using Structural and
Dataflow description.
2x4 Decoder
module decoder_2_4(a,b,w,x,y,z);
output w,x,y,z;
input a,b;
4x1 Multiplexer
Since all the bits of augend and addend are fed into the adder circuits simultaneously and the
additions in each position are taking place at the same time, this circuit is known as parallel
adder.
The bits are added with full adders, starting from the least significant position, to form the sum
it and carry bit. The input carry C0 in the least significant position must be 0. The carry output
of the lower order stage is connected to the carry input of the next higher order stage. Hence
this type of adder is called ripple-carry adder.
In the least significant stage, A0, B0 and C0 (which is 0) are added resulting in sum S0 and carry
C1. This carry C1 becomes the carry input to the second stage. Similarly in the second stage,
A1, B1 and C1 are added resulting in sum S1 and carry C2, in the third stage, A2, B2 and C2 are
added resulting in sum S2 and carry C3, in the third stage, A3, B3 and C3 are added resulting in
sum S3 and C4, which is the output carry.
Thus the circuit results in a sum (S3S2S1S0) and a carry output (Cout).
Here the 2 inputs are decoded into 4 outputs, each output representing one of the minterms of
the two input variables.
To demonstrate the circuit operation, consider the case when S1S0= 10. The AND
gate associated with input I2 has two of its inputs equal to 1 and the third input
connected to I2. The other three AND gates have atleast one input equal to 0, which
makes their outputs equal to 0. The OR output is now equal to the value of I2, providing
a path from the selected input to the output.
The data output is equal to I0 only if S1= 0 and S0= 0; Y= I0S1‘S0‘.
The data output is equal to I1 only if S1= 0 and S0= 1; Y= I1S1‘S0.
The data output is equal to I2 only if S1= 1 and S0= 0; Y= I2S1S0‘.
The data output is equal to I3 only if S1= 1 and S0= 1; Y= I3S1S0.
When these terms are ORed, the total expression for the data output is,
Y= I0S1’S0’+ I1S1’S0 +I2S1S0’+ I3S1S0.
Solution:
Variables, n= 3 (A, B, C)
Select lines= n-1 = 2 (S1, S0)
2n-1 to MUX i.e., 22 to 1 = 4 to 1 MUX
Input lines= 2n-1 = 22 = 4 (D0, D1, D2, D3)
Implementation table:
Apply variables A and B to the select lines. The procedures for implementing the
function are:
i. List the input of the multiplexer
ii. List under them all the minterms in two rows as shown below.
The first half of the minterms is associated with A‘ and the second half with A. The
given function is implemented by circling the minterms of the function and applying
the following rules to find the values for the inputs of the multiplexer.
1. If both the minterms in the column are not circled, apply 0 to the corresponding input.
2. If both the minterms in the column are circled, apply 1 to the corresponding input.
3. If the bottom minterm is circled and the top is not circled, apply C to the input.
4. If the top minterm is circled and the bottom is not circled, apply C‘ to the input.
Multiplexer Implementation:
Solution:
Variables, n= 4 (P, Q, R, S)
Select lines= n-1 = 3 (S2, S1, S0)
2n-1 to MUX i.e., 23 to 1 = 8 to 1 MUX
Input lines= 2n-1 = 23 = 8 (D0, D1, D2, D3, D4, D5, D6, D7)
Implementation table:
Multiplexer Implementation:
MODULE 3
1. With a neat diagram, Explain the basic operational concepts of a computer. Give operating
steps.10
The fig shows how memory & the processor can be connected. In addition to the ALU & the control
circuitry, the processor contains a number of registers used for several different purposes.
The instruction register (IR):- Holds the instructions that is currently being executed. Its output
is available for the control circuits which generates the timing signals that control the various
processing elements in one execution of instruction.
The program counter PC:-
This is another specialized register that keeps track of execution of a program. It contains the
memory address of the next instruction to be fetched and executed.
Besides IR and PC, there are n-general purpose registers R0 through Rn-1.
The other two registers which facilitate communication with memory are: -
1. MAR – (Memory Address Register):- It holds the address of the location to be
accessed.
2. MDR – (Memory Data Register):- It contains the data to be written into or readout
of the address location.
3. Contents of PC are transferred to MAR and a Read Control Signal is sent to the
memory.
4. After the time required to access the memory elapses, the address word is read out
of the memory and loaded into the MDR.
5. Now contents of MDR are transferred to the IR & now the instruction is ready to
be decoded and executed.
6. If the instruction involves an operation by the ALU, it is necessary to obtain the
required operands.
7. An operand in the memory is fetched by sending its address to MAR & Initiating a
read cycle.
8. When the operand has been read from the memory to the MDR, it is transferred
from MDR to the ALU.
9. After one or two such repeated cycles, the ALU can perform the desiredoperation.
10. If the result of this operation is to be stored in the memory, the result is sent to
MDR.
11. Address of location where the result is stored is sent to MAR & a write cycle is
initiated.
12. The contents of PC are incremented so that PC points to the next instruction thatis
to be executed.
In general, a program operates on data that reside in the computer’s memory. These data can be
organized in a variety of ways. If we want to keep track of students’ names, we can write them in
a list. Programmers use organizations called data structures to represent the data used in
computations. These include lists, linked lists, arrays, queues, and so on.
Programs are normally written in a high-level language, which enables the programmer to use
constants, local and global variables, pointers, and arrays. The different ways in which
the location of an operand is specified in an instruction are referred to as addressing modes.
3. Describe Big Endian and Little Endian methods of byte addressing with proper example5
There are two ways that byte addresses can be assigned across words, as shown in fig b. The name
big-endian is used when lower byte addresses are used for the more significant bytes (the leftmost
bytes) of the word. The name little-endian is used for the opposite ordering, where the lower byte
addresses are used for the less significant bytes (the rightmost bytes) of the word. In addition to
specifying the address ordering of bytes within a word, it is also necessary to specify the labeling
of bits within a byte or a word. The same ordering is also used for labeling bits within a byte, that
is, b7, b6, …., b0, from left to right.
The simplest and most common way of interconnecting various parts of the computer. To achieve a
reasonable speed of operation, a computer must be organized so that all its units can handle one
full word of data at a given time.A group of lines thatserve as a connecting port for several devices
is called a bus.
In addition to the lines that carry the data, the bus must have lines for address andcontrol purpose.
Simplest way to interconnect is to use the single bus as shown.
Since the bus can be used for only one transfer at a time, only two units can actively use the bus at
any given time. Bus control lines are used to arbitrate multiple requests for use of one bus.
Single bus structure is
• Low cost
• Very flexible for attaching peripheral devices
Multiple bus structure certainly increases, the performance but also increases the cost
significantly.
At the start of execution, all program instructions and the required data are stored in the main
memory. As the execution proceeds, instructions are fetched one by one over the bus into the
processor, and a copy is placed in the cache later if the same instruction or data item is needed a
second time, it is read directly from the cache. The processor and relatively small cache memory
can be fabricated on a single IC chip.
The internal speed of performing the basic steps of instruction processing on chip is very high and
is considerably faster than the speed at which the instruction and data can be fetched from the main
memory. A program will be executed faster if the movement of instructions and data between the
main memory and the processor is minimized, which is achieved by using the cache.
For example:- Suppose a number of instructions are executed repeatedly over a short period of time
as happens in a program loop. If these instructions are available in the cache, they can be fetched
quickly during the period of repeated use. The same applies to the data that are used repeatedly.
➢ These systems either execute a number of different application tasks in parallel or execute
subtasks of a single large task in parallel.
➢ All processors usually have access to all memory locations in such system & hence they are
called shared memory multiprocessor systems.
➢ The high performance of these systems comes with much increased complexity and cost.
➢ In contrast to multiprocessor systems, it is also possible to use an interconnected group of
complete computers to achieve high total computational power. These computers normally have
access to their own memory units when the tasks they are executing need to communicate data they
do so by exchanging messages over a communication network. This properly distinguishes them
from shared memory multiprocessors, leading to name message-passing multi computer.
MODULE 4
1. Explain DMA transfer with bus arbitration.
Cache memory is an architectural arrangement which makes the main memory appear faster to
the processor than it really is. Cache memory is based on the property of computer programs
known as “locality of reference”.
Set-associative mapping
l. The timing diagram shows the sequence of events for the devices
connected to the processor.
m. DMAcontroller-2
→ requests and acquires bus-mastership and
→ later releases the bus. (Figure: 4.21).
n. After DMA controller-2 releases the bus, the processor resources bus-
mastership.
MODULE 5
1. Illustrate the sequence of operation required to execute the instruction ADD (R3), R1 on
single bus processor.
Consider the instruction Add (R3),R1 which adds the contents of a memory-
location pointed by R3 to register R1. Executing this instruction requires the
following actions:
2. With a neat diagram, Explain multiple bus organization of computer and functional
concepts