BCS302 Previous Year Question Paper With Answer
BCS302 Previous Year Question Paper With Answer
2024 Question
paper solution
1.a. Obtain a minimum product of sums with a Karnaugh Map.
F(w,x,y,z)=x’z’+wyz+w’y’z’+x’y
1.b. Find the minimum sum of products for each function using a Karnaugh Map.
i. F1(a,b,c)=M0+M2+M5+M6
ii. F2(d,e,f)=∑m(0,1,2,4)
iii. F3(r,s,t)=rt’+r’s’+r’s
3.a. What is Latch? With the neat diagram, explain S-R Latch using NOR gate. Derive
characteristics equation.
name latches are used for a sequential device that checks all its inputs continuously and changes
its outputs accordingly at any time independent of a clocking signal.
Set-Reset Latch
S stands for set and R stands for reset. There are two inputs S is used for set and R is used for
reset. The output of SR depends on current as well as previous state. And its state changes as
soon as input change.
The SR latch can either be designed either using NOR gate or using NAND gates. The graphical
representation of SR latch is shown below:
S R Q State
0 0 Q0 No change
0 1 0 Reset
1 0 1 Set
1 1 - Invalid
S R Qn Q(n+1)
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 X
1 1 1 X
The other two outputs are not inspected when V equals 0 and are specified as don’t-care
conditions. Note that whereas X ’s in output columns represent don’t-care conditions, the X ’s
in the input columns are useful for representing a truth table in condensed form.
Instead of listing all 16 minterms of four variables, the truth table uses an X to represent either
1 or 0. For example, X100 represents the two minterms 0100 and 1100.
According to truth Table, the higher the subscript number, the higher the priority of the input.
Input D3 has the highest priority, so, regardless of the values of the other inputs, when this
input is 1, the output for xy is 11 (binary 3). D2 has the next priority level. The output is 10 if
D2 = 1, provided that D3 = 0, regardless of the values of the other two lower priority inputs.
The output for D1 is generated only if higher priority inputs are 0, and so on down the priority
levels.
The minterms for the two functions are derived from map method. Although the table has only
five rows, when each X in a row is replaced first by 0 and then by 1, we obtain all 16 possible
input combinations. For example, the fourth row in the table, with inputs XX10, represents the
four minterms 0010, 0110, 1010, and 1110. The simplified Boolean expressions for the priority
encoder are obtained from the maps. The condition for output V is an OR function of all the
input variables.
The priority encoder is implemented in Fig. according to the following Boolean functions:
Consider the circuit of the full adder shown in above Fig. If we define two new binary variables
Since the Boolean function for each output carry is expressed in sum-of-products form, each
function can be implemented with one level of AND gates followed by an OR gate.
The three Boolean functions for C1, C2, and C3 are implemented in the carry lookahead
generator shown in Fig. below. Note that this circuit can add in less time because C3 does not
have to wait for C2 and C1 to propagate; in fact, C3 is propagated at the same time as C1 and
C2. This gain in speed of operation is achieved at the expense of additional complexity
(hardware).
This type of notation is known as Register Transfer Notation (RTN). Note that the right-hand
side of an RTN expression always denotes a value, and the left- hand side is the name of a
location where the value is to be places, overwriting the old contents of that location.
To represent machine instructions and programs, assembly language format is used. The
contents of LOC are unchanged by the execution of this instruction, but the old contents of
register R1 are overwritten.
5.b. Show how below expression will be executed in one address, two address, zero address
and three address processor in an accumulator organization X=(A*B)+(C*D).
To execute the Add instruction in fig (a), the processor uses the value, which is in register R1,
as the effective address of the operand. It requests a read operation from the memory R1 to
Relative mode – The effective address is determined by the Index mode using the program
counter in place of the general-purpose register Ri. This mode can be used to access data
operands. But, its most common use is to specify the target address in branch instructions. An
instruction such as
Branch > 0 LOOP
Causes program execution to go to the branch target location identified by the name LOOP if
the branch condition is satisfied. This location can be computed by specifying it as an offset
from the current value of the program counter. Since the branch target may be either before or
after the branch instruction, the offset is given as a signed number.
Autoincrement mode – the effective address of the operand is the contents of a register
specified in the instruction. After accessing the operand, the contents of this register are
automatically to point to the next item in a list. (Ri)+.
Autodecrement mode – the contents of a register specified in the instruction are first
automatically decremented and are then used as the effective address of the operand. -(Ri)
6.b. With a neat diagram, explain basic operational concepts of a computer.
To perform a given task an appropriate program consisting of a list of instructions is stored in
the memory. Individual instructions are brought from the memory into the processor, which
executes the specified operations. Data to be stored are also stored in the memory.
Example: Add LOCA, R0
This instruction adds the operand at memory location LOCA, to operand in register R0 &
places the sum into register R0. This instruction requires the performance of several steps,
Daisy chain
7.b. Explain Direct Memory Access with a neat diagram.
The transfer of a block of data directly between an external device & main memory without
continuous involvement by processor is called DMA.
DMA controller
→ is a control circuit that performs DMA transfers
→ is a part of the I/O device interface.
→ performs the functions that would normally be carried out by processor.
While a DMA transfer is taking place, the processor can be used to execute another program.
For E.g.: Assume 2 devices A & B have their ID 5 (0101), 6 (0110), their logical OR code is
0111.
• Each device compares the pattern on the arbitration line to its own ID starting from
MSB. If the device detects a difference at any bit position, it disables the drivers at that
bit position. Driver is disabled by placing ”0” at the input of the driver.
In e.g. “A” detects a difference in line ARB1, hence it disables the drivers on lines ARB1 &
ARB0. This causes pattern on arbitration-line to change to 0110. This means that “B” has won
contention.
Associative Mapping
• Much more flexible method, but expensive.
• Main memory blocks can be placed into any cache block position. Hence there is no
need to identify a specific empty block in cache when a new block arrives. So, tag bits
of an address received from the processor are compared with the tag bits of each of
cache to see if the desired block is present.
• A new block brought into the cache has to replace an existing cache block, only if the
cache is full. Hence replacement algorithm is required. The replacement algorithm
suggests a block that is to be replaced whenever all the cache lines happen to be
occupied. So, replacement algorithms such as LRU (Least recently used) Algorithm,
FCFS Algorithm, etc., are employed.
Structural hazard
• The third type of hazard that may be encountered in pipelined operation is known as a
structural hazard. This is the situation when two instructions require the use of a given
hardware resource at the same time.
• The most common case in which this hazard may arise is in access to memory. One
instruction may need to access memory as part of the execute while another instruction
is being fetched.
• If the instructions and data reside in the same cache unit, only one instruction can
proceed, and the other instruction is delayed.
• Many processors use separate instruction and data caches to avoid this delay.
Example: Load X(R1), R2
The memory address, X+[R1], is computed in step E2 in cycle 4, then memory access takes
place in cycle 5. The operand read from memory is written into register R2 in cycle 6. This
means that execution step of this instruction takes 2 clock cycles (4 & 5). It causes the pipeline
to stall for one cycle, because both the instructions I2 and I3 require access to the register file
in cycle 6.