Professional Documents
Culture Documents
Encoders: 4 To 2 Line Encoder
Encoders: 4 To 2 Line Encoder
The combinational circuits that change the binary information into N output lines are
known as Encoders. The binary information is passed in the form of 2N input lines. The
output lines define the N-bit code for the binary information. In simple words,
the Encoder performs the reverse operation of the Decoder. At a time, only one input
line is activated for simplicity. The produced N-bit output code is equivalent to the
binary information.
4 to 2 line Encoder:
In 4 to 2 line encoder, there are total of four inputs, i.e., Y0, Y1, Y2, and Y3, and two
outputs, i.e., A0 and A1. In 4-input lines, one input-line is set to true at a time to get the
respective binary code in the output side. Below are the block diagram and the truth
table of the 4 to 2 line encoder.
Block Diagram:
Truth Table:
48.7M
957
C++ vs Java
A1=Y3+Y2
A0=Y3+Y1
8 to 3 line Encoder:
The 8 to 3 line Encoder is also known as Octal to Binary Encoder. In 8 to 3 line
encoder, there is a total of eight inputs, i.e., Y0, Y1, Y2, Y3, Y4, Y5, Y6, and Y7 and three
outputs, i.e., A0, A1, and A2. In 8-input lines, one input-line is set to true at a time to
get the respective binary code in the output side. Below are the block diagram and the
truth table of the 8 to 3 line encoder.
Block Diagram:
Truth Table:
The logical expression of the term A0, A1, and A2 are as follows:
A2=Y4+Y5+Y6+Y7
A1=Y2+Y3+Y6+Y7
A0=Y7+Y5+Y3+Y1
Block Diagram:
Truth Table:
The logical expression of the term A0, A1, A2, and A3 is as follows:
A3 = Y9 + Y8
A2 = Y7 + Y6 + Y5 +Y4
A1 = Y7 + Y6 + Y3 +Y2
A0 = Y9 + Y7 +Y5 +Y3 + Y1
Truth Table:
The logical expression of the term A0 and A1 can be found using K-map as:
A1=Y3+Y2
A0=Y3+Y2'.Y1
Decoder
The combinational circuit that change the binary information into 2N output lines is
known as Decoders. The binary information is passed in the form of N input lines. The
output lines define the 2N-bit code for the binary information. In simple words,
the Decoder performs the reverse operation of the Encoder. At a time, only one input
line is activated for simplicity. The produced 2N-bit output code is equivalent to the
binary information.
There are various types of decoders which are as follows:
2 to 4 line decoder:
In the 2 to 4 line decoder, there is a total of three inputs, i.e., A0, and A1 and E and four
outputs, i.e., Y0, Y1, Y2, and Y3. For each combination of inputs, when the enable 'E' is
set to 1, one of these four outputs will be 1. The block diagram and the truth table of
the 2 to 4 line decoder are given below.
Block Diagram:
Truth Table:
The logical expression of the term Y0, Y0, Y2, and Y3 is as follows:
37.1M
665
Stay
Y3=E.A1.A0
Y2=E.A1.A0'
Y1=E.A1'.A0
Y0=E.A1'.A0'
3 to 8 line decoder:
The 3 to 8 line decoder is also known as Binary to Octal Decoder. In a 3 to 8 line
decoder, there is a total of eight outputs, i.e., Y0, Y1, Y2, Y3, Y4, Y5, Y6, and Y7 and three
outputs, i.e., A0, A1, and A2. This circuit has an enable input 'E'. Just like 2 to 4 line
decoder, when enable 'E' is set to 1, one of these four outputs will be 1. The block
diagram and the truth table of the 3 to 8 line encoder are given below.
Block Diagram:
Truth Table:
The logical expression of the term Y0, Y1, Y2, Y3, Y4, Y5, Y6, and Y7 is as follows:
Y0=A0'.A1'.A2'
Y1=A0.A1'.A2'
Y2=A0'.A1.A2'
Y3=A0.A1.A2'
Y4=A0'.A1'.A2
Y5=A0.A1'.A2
Y6=A0'.A1.A2
Y7=A0.A1.A2
4 to 16 line Decoder
In the 4 to 16 line decoder, there is a total of 16 outputs, i.e., Y0, Y1, Y2,……, Y16 and four
inputs, i.e., A0, A1, A2, and A3. The 3 to 16 line decoder can be constructed using either
2 to 4 decoder or 3 to 8 decoder. There is the following formula used to find the
required number of lower-order decoders.
m1 = 8
m2 = 16
Required number of 3 to 8 decoders= =2
Block Diagram:
Truth Table:
The logical expression of the term A0, A1, A2,…, A15 are as follows:
Y0=A0'.A1'.A2'.A3'
Y1=A0'.A1'.A2'.A3
Y2=A0'.A1'.A2.A3'
Y3=A0'.A1'.A2.A3
Y4=A0'.A1.A2'.A3'
Y5=A0'.A1.A2'.A3
Y6=A0'.A1.A2.A3'
Y7=A0'.A1.A2.A3
Y8=A0.A1'.A2'.A3'
Y9=A0.A1'.A2'.A3
Y10=A0.A1'.A2.A3'
Y11=A0.A1'.A2.A3
Y12=A0.A1.A2'.A3'
Y13=A0.A1.A2'.A3
Y14=A0.A1.A2.A3'
Y15=A0.A1.A2'.A3
Half Adder
The Half-Adder is a basic building block of adding two numbers as two inputs and
produce out two outputs. The adder is used to perform OR operation of two single bit
binary numbers. The augent and addent bits are two input states, and 'carry'
and 'sum 'are two output states of the half adder.
Block diagram
Truth Table
1. 'A' and' B' are the input states, and 'sum' and 'carry' are the output states.
2. The carry output is 0 in case where both the inputs are not 1.
3. The least significant bit of the sum is defined by the 'sum' bit.
Sum=x'y+xy'
Carry = xy
Full Adder
The half adder is used to add only two numbers. To overcome this problem, the full
adder was developed. The full adder is used to add three 1-bit binary numbers A, B,
and carry C. The full adder has three input states and two output states i.e., sum and
carry.
Block diagram
Truth Table
1. 'A' and' B' are the input variables. These variables represent the two significant bits
which are going to be added
2. 'Cin' is the third input which represents the carry. From the previous lower significant
position, the carry bit is fetched.
3. The 'Sum' and 'Carry' are the output variables that define the output values.
4. The eight rows under the input variable designate all possible combinations of 0 and
1 that can occur in these variables.
The full adder logic circuit can be constructed using the 'AND' and the 'XOR'
gate with an OR gate.
The actual logic circuit of the full adder is shown in the above diagram. The full adder
circuit construction can also be represented in a Boolean expression.
Sum:
o Perform the XOR operation of input A and B.
o Perform the XOR operation of the outcome with carry. So, the sum is (A XOR B) XOR
Cin which is also represented as:
(A ⊕ B) ⊕ Cin
Carry:
1. Perform the 'AND' operation of input A and B.
2. Perform the 'XOR' operation of input A and B.
3. Perform the 'OR' operations of both the outputs that come from the previous two
steps. So the 'Carry' can be represented as:
A.B + (A ⊕ B)
Unit 4
Removing the CPU from the path and letting the peripheral device manage the
memory buses directly would improve the speed of transfer.
In this, the interface transfer data to and from the memory through memory
bus. A DMA controller manages to transfer data between peripherals and
memory unit.
Many hardware systems use DMA such as disk drive controllers, graphic cards,
network cards and sound cards etc.
In DMA, CPU would initiate the transfer, do other operations while the transfer
is in progress and receive an interrupt from the DMA controller when the
transfer has been completed.
Bus Request (BR): used by DMA controller to request the CPU for buses. When
this input is active, CPU terminates the execution of the current instruction and
places the address bus; data bus and read & write lines into high impedance
state.
Bus Grant (BG): CPU activates BG output to inform DMA that buses are
available (in high impedance state). DMA now take control over buses to
conduct memory transfers without processor intervention. When DMA
terminates the transfer, it disables the BR line and CPU disables BG and returns
to normal operation.
– BBSY (bus busy) line - open collector line - the current bus master i di n cates
d i ev ces that it is currently using the bus by signaling this line
Hardware Interrupts
When the signal for the processor is from an external device or hardware then
this interrupts is known as hardware interrupt.
Maskable Interrupt
The asynchronous data transfer between two independent units requires that
control signals be transmitted between the communicating units to indicate
when they send the data. Thus, the two methods can achieve the asynchronous
way of data transfer.
b. Destination initiated strobe: In the below block diagram, you see that the
strobe initiated by destination, and in the timing diagram, the destination
unit first activates the strobe pulse, informing the source to provide the
data.
UNIT 3
Machine Instructions: -
Machine Instructions are commands or programs written in machine code of a machine
(computer) that it can recognize and execute.
A machine instruction consists of several bytes in memory that tells the processor to
perform one machine operation.
The processor looks at machine instructions in main memory one after another, and
performs one machine operation for each machine instruction.
The collection of machine instructions in main memory is called a machine language
program.
Machine code or machine language is a set of instructions executed directly by a computer’s
central processing unit (CPU). Each instruction performs a very specific task, such as a load,
a jump, or an ALU operation on a unit of data in a CPU register or memory. Every program
directly executed by a CPU is made up of a series of such instructions.
The general format of a machine instruction is
I/O
● The data on which the instruc ons operate are not necessarily already stored in memory.
● Data need to be transferred between processor and outside world (disk, keyboard, etc.)
● I/O opera ons are essen al, the way they are performed can have a significant effect on the
performance of the computer.
Difference in speed between processor and I/O device creates the need for mechanisms to
synchronize the transfer of data.
A solution: on output, the processor sends the first character and then waits for a signal from the
display that the character has been received. It then sends the second character. Input is sent from
the keyboard in a similar way.
ARM
Advanced RISC Machine (ARM) Processor is considered to be family of Central
Processing Units that is used in music players, smartphones, wearables, tablets
and other consumer electronic devices.
The architecture of ARM processor is created by Advanced RISC Machines,
hence name ARM. This needs very few instruction sets and transistors. It has
very small size. This is reason that it is perfect fit for small size devices. It has
less power consumption along with reduced complexity in its circuits.
They can be applied to various designs such as 32-bit devices and embedded
systems. They can even be upgraded according to user needs.
RISC
RISC stands for Reduced Instruction Set Computer Processor, a microprocessor
architecture with a simple collection and highly customized set of instructions. It is
built to minimize the instruction execution time by optimizing and limiting the number
of instructions. It means each instruction cycle requires only one clock cycle, and each
cycle contains three parameters: fetch, decode and execute. The RISC processor is also
used to perform various complex instructions by combining them into simpler ones.
RISC chips require several transistors, making it cheaper to design and reduce the
execution time for instruction.
Examples of RISC processors are SUN's SPARC, PowerPC, Microchip PIC processors,
RISC-V.
OPCODE
An Opcode is also known as Operation code. In computer architecture and
microprocessor instruction, the Opcode is the task to be performed by the
computer on the operand.
Example: SUB D The above instruction will subtract the content of register D
with the accumulator. The SUB is the Opcode while the D and accumulator
are operands.
LDR
Generally, LDR is used to load something from memory into a register, and STR is used
to store something from a register to a memory address.
LDR r2,[r1]
This instruction will take the address in r1, and then load a 4 byte value from the
memory pointed to by it into register r2.