Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

COA Unit1 Notes

Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

Unit-1

What is Computer
What is Computer : Computer is an electronic device that is designed to work
with Information. The term computer is derived from the Latin term ‘computare’, this
means to calculate or programmable machine. Computer can not do anything
without a Program. It represents the decimal numbers through a string of binary
digits. The Word ‘Computer’ usually refers to the Center Processor Unit plus
Internal memory.
Charles Babbage is called the “Grand Father” of the computer. The First
mechanical computer designed by Charles Babbage was called Analytical
Engine. It uses read-only memory in the form of punch cards.
The computer is an electronic device that takes input from the user and processes
these data under the control of a set of instructions (called program) and gives the
result (output) and saves future use. It can process both numerical and non-numerical
(arithmetic and logical) calculations.

Digital Computer Definition

The basic components of a modern digital computer are: Input Device, Output
Device, Central Processor Unit (CPU), mass storage device and memory. A Typical
modern computer uses LSI Chips. Four Functions about computer are:

Accepts data Input


Processes data Processing
Produces output Output
Stores results Storage

Input (Data):
Input is the raw information entered into a computer from the input devices. It is the
collection of letters, numbers, images etc.
Unit-1

Process:
Process is the operation of data as per given instruction. It is totally internal process
of the computer system.
Output:
Output is the processed data given by computer after data processing. Output is also
called as Result. We can save these results in the storage devices for the future use.
Computer Classification: By Size and Power

Computers differ based on their data processing abilities. They are classified
according to purpose, data handling and functionality.
According to functionality, computers are classified as:

• Analog Computer: A computer that represents numbers by some continuously


variable physical quantity, whose variations mimic some system’s properties being
modeled.
• Personal computer: A personal computer is a computer small and low cost. The
term”personal computer” is used to describe desktop computers.
• Workstation: A terminal or desktop computer in a network. In this context, the
workstation is just a generic term for a user’s machine (client machine) in contrast to
a “server” or “mainframe.”
• Minicomputer: A minicomputer isn’t very mini. At least, not in the way most of us
think of mini. You know how big your personal computer is and its related family.
• Mainframe: It refers to the kind of large computer that runs an entire corporation.
• Supercomputer: It is the most giant, fastest, and most expensive computers on
earth.
• Microcomputer: Your personal computer is a microcomputer.

Computer architecture ->


Computer architecture comprises rules, methods, and procedures that describe
the execution and functionality of the entire computer system. In general
terms, computer architecture refers to how a computer system is designed
using compatible technologies. This article will tell you how computer
architecture is classified into a disciplinary method.
Unit-1

Types->
 Von-Neumann Architecture
 Harvard Architecture
 Instruction Set Architecture
 Micro-architecture
 System Design

Historically there have been 2 types of Computers:

1. Fixed Program Computers – Their function is very specific and they


couldn’t be re-programmed, e.g. Calculators.
2. Stored Program Computers – These can be programmed to carry out
many different tasks, applications are stored on them, hence the name.

The modern computers are based on a stored-program concept introduced by


John Von Neumann. In this stored-program concept, programs and data are
stored in a separate storage unit called memories and are treated the same.
This novel idea meant that a computer built with this architecture would be
much easier to reprogram.

The basic structure is like this,


Unit-1

It is also known as ISA (Instruction set architecture) computer and is having


three basic units:

1. The Central Processing Unit (CPU)


2. The Main Memory Unit
3. The Input/Output Device

Let’s consider them in details.

 Control Unit –
A control unit (CU) handles all processor control signals. It directs all
input and output flow, fetches code for instructions, and controls how
data moves around the system.
 Arithmetic and Logic Unit (ALU) –
The arithmetic logic unit is that part of the CPU that handles all the
calculations the CPU may need, e.g. Addition, Subtraction, Comparisons.
It performs Logical Operations, Bit Shifting Operations, and Arithmetic
operations.

Figure – Basic CPU structure, illustrating ALU

 Main Memory Unit (Registers) –


1. Accumulator: Stores the results of calculations made by ALU.
Unit-1

2. Program Counter (PC): Keeps track of the memory location of the


next instructions to be dealt with. The PC then passes this next
address to Memory Address Register (MAR).
3. Memory Address Register (MAR): It stores the memory locations of
instructions that need to be fetched from memory or stored into
memory.
4. Memory Data Register (MDR): It stores instructions fetched from
memory or any data that is to be transferred to, and stored in,
memory.
5. Current Instruction Register (CIR): It stores the most recently
fetched instructions while it is waiting to be coded and executed.
6. Instruction Buffer Register (IBR): The instruction that is not to be
executed immediately is placed in the instruction buffer register
IBR.

 Input/Output Devices – Program or data is read into main memory from


the input device or secondary storage under the control of CPU input
instruction. Output devices are used to output the information from a
computer. If some results are evaluated by computer and it is stored in
the computer, then with the help of output devices, we can present them
to the user.
 Buses – Data is transmitted from one part of a computer to another,
connecting all major internal components to the CPU and memory, by
the means of Buses. Types:
1. Data Bus: It carries data among the memory unit, the I/O devices,
and the processor.
2. Address Bus: It carries the address of data (not the actual data)
between memory and processor.
3. Control Bus: It carries control commands from the CPU (and status
signals from other devices) in order to control and coordinate all
the activities within the computer.

Von Neumann bottleneck –


Whatever we do to enhance performance, we cannot get away from the fact
that instructions can only be done one at a time and can only be carried out
sequentially. Both of these factors hold back the competence of the CPU. This is
commonly referred to as the ‘Von Neumann bottleneck’. We can provide a Von
Neumann processor with more cache, more RAM, or faster components but if
original gains are to be made in CPU performance then an influential inspection
needs to take place of CPU configuration.
Unit-1

Digital Logic ->


Digital logic hides the pitfalls of the analog world by mapping all physical values as sequences of 0s
and 1s. • Regardless of what type of digital circuit we use, 0 and 1 are represented by two ranges
separated by an undefined range in between. These two ranges are called low and high respectively.

Logic Gates
o The logic gates are the main structural part of a digital system.

o Logic Gates are a block of hardware that produces signals of binary 1 or 0 when input logic
requirements are satisfied.

o Each gate has a distinct graphic symbol, and its operation can be described by means of
algebraic expressions.

o The seven basic logic gates includes: AND, OR, XOR, NOT, NAND, NOR, and XNOR.

o The relationship between the input-output binary variables for each gate can be
represented in tabular form by a truth table.

o Each gate has one or two binary input variables designated by A and B and one binary
output variable designated by x.

AND GATE:
The AND gate is an electronic circuit which gives a high output only if all its inputs are high. The AND
operation is represented by a dot (.) sign.

OR GATE:
Unit-1
The OR gate is an electronic circuit which gives a high output if one or more of its inputs are high.
The operation performed by an OR gate is represented by a plus (+) sign.

NOT GATE:
The NOT gate is an electronic circuit which produces an inverted version of the input at its output. It
is also known as an Inverter.

NAND GATE:
The NOT-AND (NAND) gate which is equal to an AND gate followed by a NOT gate. The NAND gate
gives a high output if any of the inputs are low. The NAND gate is represented by a AND gate with a
small circle on the output. The small circle represents inversion.

NOR GATE:
The NOT-OR (NOR) gate which is equal to an OR gate followed by a NOT gate. The NOR gate gives a
low output if any of the inputs are high. The NOR gate is represented by an OR gate with a small
circle on the output. The small circle represents inversion.
Unit-1

Exclusive-OR/ XOR GATE:


The 'Exclusive-OR' gate is a circuit which will give a high output if one of its inputs is high but not
both of them. The XOR operation is represented by an encircled plus sign.

EXCLUSIVE-NOR/Equivalence GATE:
The 'Exclusive-NOR' gate is a circuit that does the inverse operation to the XOR gate. It will give a low
output if one of its inputs is high but not both of them. The small circle represents inversion.
Unit-1

What are Universal Gates->


Universal Gates may implement any Boolean function without using any other gate
type. The NAND gate and NOR gate are called Universal gates because they can
perform all the three essential functions of AND, OR and NOT gates.

A two-input NAND gate is a digital combination logic circuit that performs the logical
inverse of an AND gate. While an AND gate outputs a logical "1" only if both inputs
are logical "1," a NAND gate outputs a logical "0" for this same combination of
inputs.

There are two universal gates:

 NAND Gate
 NOR Gate

Realization of the Logic Gate: Using NAND Gate and NOR Gate

NOT Gate Realization

Using NAND gate

For the NOT gate realization, we require 1 NAND gate, as shown in the circuit
diagram:

Using NOR gate

For the NOT gate realization, we require 1 NOR gate, as shown in the circuit diagram:

AND Gate Realization

Using NAND gate

For the AND gate realization, we require 2 NAND gates, as shown in the circuit
diagram:
Unit-1

Using NOR gate

For the AND gate realization, we require 3 NOR gates if the inputs are not available in
complement form, as shown in the circuit diagram:

OR Gate Realization

Using NAND gate

For the OR gate realization, we require 3 NAND gates if the inputs are not available in
complement form, as shown in the circuit diagram:

Using NOR gate

For the OR gate realization, we require 2 NOR gates, as shown in the circuit diagram:
Unit-1

Boolean algebra->
Boolean algebra can be considered as an algebra that deals with binary variables and
logic operations. Boolean algebraic variables are designated by letters such as A, B, x,
and y. The basic operations performed are AND, OR, and complement.

The Boolean algebraic functions are mostly expressed with binary variables, logic
operation symbols, parentheses, and equal sign. For a given value of variables, the
Boolean function can be either 1 or 0. For instance, consider the Boolean function:

F = x + y'z

The logic diagram for the Boolean function F = x + y'z can be represented as:

o The Boolean function F = x + y'z is transformed from an algebraic expression


into a logic diagram composed of AND, OR, and inverter gates.
o Inverter at input 'y' generates its complement y'.
o There is an AND gate for the term y'z, and an OR gate is used to combine the
two terms (x and y'z).
o The variables of the function are taken to be the inputs of the circuit, and the
variable symbol of the function is taken as the output of the circuit.

Examples of Boolean algebra simplifications using logic gates

o In this section, we will look at some of the examples of Boolean algebra


simplification using Logic gates.
Unit-1

o 1. F1 = xyz'

o 2. F2 = x + y'z

o 3. F3 = xy' + x'z

o 4. F4 = x'y'z + x'yz + xy'

Laws and Rules of Boolean algebra->


Unit-1
In simplification of the Boolean expression, the laws and rules of the Boolean algebra play an
important role. Before understanding these laws and rules of Boolean algebra, understand the
Boolean operations addition and multiplication concept.

Boolean Addition
The addition operation of Boolean algebra is similar to the OR operation. In digital circuits, the
OR operation is used to calculate the sum term, without using AND operation. A + B, A + B', A + B
+ C', and A' + B + + D' are some of the examples of 'sum term'. The value of the sum term is true
when one or more than one literals are true and false when all the literals are false.

Boolean Multiplication
The multiplication operation of Boolean algebra is similar to the AND operation. In digital
circuits, the AND operation calculates the product, without using OR operation. AB, AB, ABC, and
ABCD are some of the examples of the product term. The value of the product term is true when
all the literals are true and false when any one of the literal is false.

Laws of Boolean algebra


There are the following laws of Boolean algebra:

Commutative Law

This law states that no matter in which order we use the variables. It means that the order of
variables doesn't matter. In Boolean algebra, the OR and the addition operations are similar. In
the below diagram, the OR gate display that the order of the input variables does not matter at
all.

For two variables, the commutative law of addition is written as:

A+B = B+A

For two variables, the commutative law of multiplication is written as:

A.B = B.A
Unit-1

Associative Law

This law states that the operation can be performed in any order when the variables priority is
same. As '*' and '/' have same priority. In the below diagram, the associative law is applied to
the 2-input OR gate.

For three variables, the associative law of addition is written as:

A + (B + C) = (A + B) + C

For three variables, the associative law of multiplication is written as:

A(BC) = (AB)C

According to this law, no matter in what order the variables are grouped when ANDing more
than two variables. In the below diagram, the associative law is applied to 2-input AND gate.

Distributive Law:

According to this law, if we perform the OR operation of two or more variables and then
perform the AND operation of the result with a single variable, then the result will be similar to
Unit-1
performing the AND operation of that single variable with each two or more variable and then
perform the OR operation of that product. This law explains the process of factoring.

For three variables, the distributive law is written as:

A(B + C) = AB + AC

Rules of Boolean algebra

There are the following rules of Boolean algebra, which are mostly used in manipulating and
simplifying Boolean expressions. These rules plays an important role in simplifying boolean
expressions.

1. A+0=A 7. A.A=A

2. A+1=1 8. A.A'=0

3. A.0=0 9. A''=A

4. A.1=A 10. A+AB=A

5. A+A=A 11. A+A'B=A+B

6. A+A'=1 12. (A+B)(A+C)=A+BC

Rule 1: A + 0 = A

Let's suppose; we have an input variable A whose value is either 0 or 1. When we perform OR
operation with 0, the result will be the same as the input variable. So, if the variable value is 1,
then the result will be 1, and if the variable value is 0, then the result will be 0. Diagrammatically,
this rule can be defined as:
Unit-1

Rule 2: (A + 1) = 1

Let's suppose; we have an input variable A whose value is either 0 or 1. When we perform OR
operation with 1, the result will always be 1. So, if the variable value is either 1 or 0, then the
result will always be 1. Diagrammatically, this rule can be defined as:

Rule 3: (A.0) = 0

Let's suppose; we have an input variable A whose value is either 0 or 1. When we perform the
AND operation with 0, the result will always be 0. This rule states that an input variable ANDed
with 0 is equal to 0 always. Diagrammatically, this rule can be defined as:

Rule 4: (A.1) = A

Let's suppose; we have an input variable A whose value is either 0 or 1. When we perform the
AND operation with 1, the result will always be equal to the input variable. This rule states that
an input variable ANDed with 1 is equal to the input variable always. Diagrammatically, this rule
can be defined as:
Unit-1

Rule 5: (A + A) = A

Let's suppose; we have an input variable A whose value is either 0 or 1. When we perform the
OR operation with the same variable, the result will always be equal to the input variable. This
rule states an input variable ORed with itself is equal to the input variable always.
Diagrammatically, this rule can be defined as:

Rule 6: (A + A') = 1

Let's suppose; we have an input variable A whose value is either 0 or 1. When we perform the
OR operation with the complement of that variable, the result will always be equal to 1. This rule
states that a variable ORed with its complement is equal to 1 always. Diagrammatically, this rule
can be defined as:

Rule 7: (A.A) = A

Let's suppose; we have an input variable A whose value is either 0 or 1. When we perform the
AND operation with the same variable, the result will always be equal to that variable only. This
rule states that a variable ANDed with itself is equal to the input variable always.
Diagrammatically, this rule can be defined as:
Unit-1

Rule 8: (A.A') = 0

Let's suppose; we have an input variable A whose value is either 0 or 1. When we perform the
AND operation with the complement of that variable, the result will always be equal to 0. This
rule states that a variable ANDed with its complement is equal to 0 always. Diagrammatically,
this rule can be defined as:

Rule 9: A = (A')'

This rule states that if we perform the double complement of the variable, the result will be the
same as the original variable. So, when we perform the complement of variable A, then the
result will be A'. Further if we again perform the complement of A', we will get A, that is the
original variable.

Rule 10: (A + AB) = A

We can prove this rule by using the rule 2, rule 4, and the distributive law as:

A + AB = A(1 + B) Factoring (distributive law)


A + AB = A.1 Rule 2: (1 + B)= 1
A + AB = A Rule 4: A .1 = A
Unit-1

Rule 11: A + AB = A + B

We can prove this rule by using the above rules as:

A + AB = (A + AB)+ AB Rule 10: A = A + AB


A+AB= (AA + AB)+ AB Rule 7: A = AA
A+AB=AA +AB +AA +AB Rule 8: adding AA = 0
A+AB= (A + A)(A + B) Factoring
A+AB= 1.(A + B) Rule 6: A + A = 1
A+AB=A + B Rule 4: drop the 1

Rule 12: (A + B)(A + C) = A + BC

We can prove this rule by using the above rules as:

(A + B)(A + C)= AA + AC + AB + BC Distributive law


(A + B)(A + C)= A + AC + AB + BC Rule 7: AA = A
(A + B)(A + C)= A( 1 + C)+ AB + BC Rule 2: 1 + C = 1
(A + B)(A + C)= A.1 + AB + BC Factoring (distributive law)
(A + B)(A + C)= A(1 + B)+ BC Rule 2: 1 + B = 1
(A + B)(A + C)= A.1 + BC Rule 4: A .1 = A
(A + B)(A + C)= A + BC
Unit-1

Combinational Circuits
Combinational circuit is a circuit in which we combine the different gates in the circuit.

A logic gate is a basic building block of any electronic circuit. The output of the combinational circuit
depends on the values at the input at any given time. The circuits do not make use of any memory or
storage device.

Examples are : encoder, decoder, multiplexer and demultiplexer.

Combinational logic is used in computer circuits to perform Boolean algebra on input signals and on
stored data.Other circuits used in computers, such as half adders, full adders, half subtractors, full
subtractors, multiplexers, demultiplexers, encoders and decoders are also made by using
combinational logic.

Some of the characteristics of combinational circuits are following :

● The output of a combina onal circuit at any instant of me, depends only on

the levels present at input terminals.

● It does not use any memory. The previous state of input does not have any

effect on the present state of the circuit.

● It can have an n number of inputs and m number of outputs


Unit-1

Adder
What is an Adder?

An adder is a circuit that can be integrated with many other circuits for a wide range

of applications. It is a kind of calculator used to add two binary numbers. There are

two kinds of adders;


1. Half adder
2. Full adder
Half Adder

With the help of half adder, we can design circuits that are capable of performing

simple addition with the help of logic gates.

Example of the addition of single bits.

0+0 = 0

0+1 = 1

1+0 = 1

1+1 = 10

These are the possible single-bit combinations. But the result for 1+1 is 10. Though

this problem can be solved with the help of an EXOR Gate, the sum result must be

re-written as a 2-bit output.

Thus the above equations can be written as:

0+0 = 00

0+1 = 01

1+0 = 01

1+1 = 10

Here the output ‘1’of ‘10’ becomes the carry-out. The result is shown in a truthtable below. ‘SUM’ is
the normal output and ‘CARRY’ is the carry-out.
Unit-1
INPUTS OUTPUTS

A B SUM CARRY

0 0 0 0

0 1 1 0

1 0 1 0

1 1 0 1

From the equation, it is clear that this 1-bit adder can be easily implemented with

the help of EXOR Gate for the output ‘SUM’ and an AND Gate for the carry. Take

a look at the implementation below.

Half Adder Circuit

Mux, De-Mux
Multiplexer is a combinational circuit that has a maximum of 2n data inputs, ‘n’ selection lines and
single output line. One of these data inputs will be connected to the output based on the values of
selection lines.

Since there are ‘n’ selection lines, there will be 2n possible combinations of zeros and ones. So, each
combination will select only one data input. Multiplexer is also called as Mux

2x1 Multiplexer
2x1 Multiplexer has two data inputs I1 & I0, one selection line S and one output Y.

The block diagram of 2x1 Multiplexer is shown in the following figure.

Truth table of 4x1 Multiplexer is shown below.


Unit-1

Input Selection Lines (S) OUTPUT (Y)

i0 0 i0

i1 1 i1

The Boolean function for output, Y as

Y= S’I0 + SI1

The circuit diagram of 2x1 multiplexer is as below

4x1 Multiplexer
4x1 Multiplexer has four data inputs I3, I2, I1 & I0, two selection lines s1 & s0 and

one output Y. The block diagram of 4x1 Multiplexer is shown in the following

figure.
Unit-1

De-Multiplexer
De-Multiplexer De-Multiplexer or demux is a combinational circuit that performs the reverse
operation of a Multiplexer. It has single input,and selects one of many data output lines,which is
connected to the single input. It has ‘n’ selection lines and maximum of 2n outputs. Since there are
Unit-1
‘n’ selection lines, there will be 2n possible combinations of zeros and ones. So, each combination
can select only one output.

the process of getting information from one input and transmitting the same over one of many
outputs is called demultiplexing. There are several types of demultiplexers based on the output
configurations such as 1:2, 1:4, 1:8 and 1:16

Demultiplexer
It has one input line and two output lines, one select line.

(Take note : 2n = Number of output lines

Where as n is the number of select lines .

Therefore 21 = 2)

In the figure, there are only two possible ways to connect the input to output lines, thus only one
select signal is enough to do the demultiplexing operation. When the select input is low, then the
input will be passed to Y0 and if the select input is high then the input will be passed to Y1.
Unit-1

1:4 De-Multiplexer :

1:4 De-Multiplexer has one input D, two selection lines, s1 & s0 and four outputs

Y3, Y2, Y1 &Y0. The block diagram of 1:4 De-Multiplexer is shown in the following

Figure
Unit-1

You might also like