Você está na página 1de 7

UNIT : IV

Logic gates:
A logic gate is an elementary building block of a digital circuit. Most logic gates have two inputs
and one output.
Digital systems are said to be constructed by using logic gates. These gates are the AND,
OR, NOT, NAND, NOR, XOR and XNOR gates. The basic operations are described below
with the aid of truth tables.

1. AND gate

The AND gate is an electronic circuit that gives a high output (1) only if all its
inputs are high. A dot (.) is used to show the AND operation i.e. A.B. Bear in
mind that this dot is sometimes omitted i.e.

2. OR gate

The OR gate is an electronic circuit that gives a high output (1) if one or more
of its inputs are high. A plus (+) is used to show the OR operation.

3. NOT gate

The NOT gate is an electronic circuit that produces an inverted version of the input at
its output. It is also known as an inverter. If the input variable is A, the inverted
output is known as NOT A.

4. NAND gate
This is a NOT-AND gate which is equal to an AND gate followed by a NOT
gate. The outputs of all NAND gates are high if any of the inputs are low. The
symbol is an AND gate with a small circle on the output. The small circle
represents inversion.

5. NOR gate

This is a NOT-OR gate which is equal to an OR gate followed by a NOT


gate. The outputs of all NOR gates are low if any of the inputs are high.
The symbol is an OR gate with a small circle on the output. The small circle
represents inversion.

6. XOR gate

The 'Exclusive-OR' gate is a circuit which will give a high output if either, but
not both, of its two inputs are high. An encircled plus sign ( ) is used to show
the EOR operation.

7. XNOR gate

The 'Exclusive-NOR'gate circuit does the opposite to the EOR gate.


It will give a low output if either, but not both, of its two inputs
are high. The symbol is an XOR gate with a small circle on the
output. The small circle represents inversion.

The NAND and NOR gates are called universal functions since with either one
the AND and OR functions and NOT can be generated.
DECODER
A decoder is a circuit that changes a code into a set of signals. It is called a decoder because it does the
reverse of encoding, but we will begin our study of encoders and decoders with decoders because they
are simpler to design.
A common type of decoder is the line decoder which takes an n-digit binary number and decodes it into
2n data lines.
1 to 2 decoder:

A is the address and D is the dataline. D0 is NOT A and D1 is A. The circuit looks like

Only slightly more complex is the 2-to-4 line decoder. The truth table is

2 to 4 Decoder
Let 2 to 4 Decoder has two inputs A1& A0 and four outputs Y3, Y2, Y1& Y0. The block diagram of
2 to 4 decoder is shown in the following figure.
Bus system:
Inside computers, there are many internal components. In order for these components to communicate
with each other they make use of wires that are known as a ‘bus’ .
A bus is a common pathway through which information flows from one computer component to
another. This pathway is used for communication purpose and it is established between two or more
computer components. We are going to check different computer bus architectures that are found in
computers.
Different Types of Computer Buses

Functions of Buses in Computers


Summary of functions of buses in computers
1. Data sharing - All types of buses found in a computer transfer data between the computer
peripherals connected to it.
The buses transfer or send data in either serial or parallel method of data transfer. This allows for the
exchange of 1, 2, 4 or even 8 bytes of data at a time. (A byte is a group of 8 bits). Buses are classified
depending on how many bits they can move at the same time, which means that we have 8-bit, 16-bit,
32-bit or even 64-bit buses.
2. Addressing - A bus has address lines, which match those of the processor. This allows data to be
sent to or from specific memory locations.
3. Power - A bus supplies power to various peripherals connected to it.
4. Timing - The bus provides a system clock signal to synchronize the peripherals attached to it with
the rest of the system.
The expansion bus facilitates easy connection of more or additional components and devices on a
computer such as a TV card or sound card.

Bus Terminologies
Computers have two major types of buses:
1. System bus:- This is the bus that connects the CPU to main memory on the motherboard. The
system bus is also called the front-side bus, memory bus, local bus, or host bus.
2. A number of I/O Buses, (I/O is an acronym for input / output), connecting various peripheral
devices to the CPU. These devices connect to the system bus via a ‘bridge’ implemented in the
processors chipset. Other names for the I/O bus include “expansion bus", "external bus” or “host bus”.
Registers
Register are used to quickly accept, store, and transfer data and instructions that are being used
immediately by the CPU, there are various types of Registers those are used for various purpose.
Registers Perform:-
1) Fetch: The Fetch Operation is used for taking the instructions those are given by the user and
the Instructions those are stored into the Main Memory will be fetch by using Registers.
2) Decode: The Decode Operation is used for interpreting the Instructions means the Instructions
are decoded means the CPU will find out which Operation is to be performed on the Instructions.
3) Execute: The Execute Operation is performed by the CPU. And Results those are produced by
the CPU are then Stored into the Memory and after that they are displayed on the user Screen.

Types of Registers are as Followings


1. MAR stand for Memory Address Register
This register holds the memory addresses of data and instructions. This register is used to access
data and instructions from memory during the execution phase of an instruction.
2. Program Counter
The program counter (PC), commonly called the instruction pointer (IP) in Intel x86
microprocessors, and sometimes called the instruction address register, or just part of the
instruction sequencer in some computers, is a processor register
3. Accumulator Register
This Register is used for storing the Results those are produced by the System. When the CPU
will generate Some Results after the Processing then all the Results will be Stored into the AC
Register.
4. Memory Data Register (MDR)
MDR is the register of a computer’s control unit that contains the data to be stored in the
computer storage (e.g. RAM), or the data after a fetch from the computer storage.
5. Index Register
A hardware element which holds a number that can be added to (or, in some cases, subtracted
from) the address portion of a computer instruction to form an effective address.
6. Memory Buffer Register
MBR stand for Memory Buffer Register. This register holds the contents of data or instruction
read from, or written in memory.
7. Data Register
A register used in microcomputers to temporarily store data being transmitted to or from a
peripheral device.
Instruction Cycle :
An instruction cycle, also known as fetch-decode-execute cycle is the basic operational process
of a computer. This process is repeated continuously by CPU from boot up to shut down of
computer.
Following are the steps that occur during an instruction cycle:

Multiplexers:
Definition

 A multiplexer selects one of its inputs to direct to the output depending on


the binary code provided at the select inputs
 Multiplexer receives a M-bit selection code

 Only one of N inputs is directed at the output

 Always: 2M = N
Addressing Modes:
The operation field of an instruction specifies the operation to be performed. This operation will
be executed on some data which is stored in computer registers or the main memory. The way
any operand is selected during the program execution is dependent on the addressing mode of the
instruction. The purpose of using addressing modes is as follows:
1. To give the programming versatility to the user.
2. To reduce the number of bits in addressing field of instruction.
Addressing
Types of Addressing Modes:
Immediate Mode
In this mode, the operand is specified in the instruction itself. An immediate mode instruction
has an operand field rather than the address field.
For example: ADD 7, which says Add 7 to contents of accumulator. 7 is the operand here.
Register Mode
In this mode the operand is stored in the register and this register is present in CPU. The
instruction has the address of the Register where the operand is stored.
Register Indirect Mode
In this mode, the instruction specifies the register whose contents give us the address of operand
which is in memory. Thus, the register contains the address of operand rather than the operand
itself.
Auto Increment/Decrement Mode
In this the register is incremented or decremented after or before its value is used.
Direct Addressing Mode
In this mode, effective address of operand is present in instruction itself.
Indirect Addressing Mode
In this, the address field of instruction gives the address where the effective address is stored in
memory. This slows down the execution, as this includes multiple memory lookups to find the
operand.
Displacement Addressing Mode
In this the contents of the indexed register is added to the Address part of the instruction, to
obtain the effective address of operand.
Relative Addressing Mode
It is a version of Displacement addressing mode.
In this the contents of PC(Program Counter) is added to address part of instruction to obtain the
effective address.
Base Register Addressing Mode
It is again a version of Displacement addressing mode. This can be defined as EA = A + (R),
where A is displacement and R holds pointer to base address.

Você também pode gostar