0% found this document useful (0 votes)
16 views43 pages

Micro by Group Three

Central Processing Units are found in nearly all electronic devices and act as the 'brains' of computing systems. A microprocessor is similar to a CPU but not all microprocessors are CPUs. The 8086 instruction set includes data transfer, arithmetic, logical, rotate, shift, branch, and string instructions used to perform various operations.

Uploaded by

amentiabraham674
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views43 pages

Micro by Group Three

Central Processing Units are found in nearly all electronic devices and act as the 'brains' of computing systems. A microprocessor is similar to a CPU but not all microprocessors are CPUs. The 8086 instruction set includes data transfer, arithmetic, logical, rotate, shift, branch, and string instructions used to perform various operations.

Uploaded by

amentiabraham674
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

MIZAN TEPI UNIVERSITY

TEPI CAMPUS
SCHOOL OF COMPUTING AND INFORMATICS
DEPARTMENT OF SOFTWARE ENGINEERING
COURSE MICROPROCESSORS AND ASSEMBLY(SEng 3031)
GROUP THREE

GROUP Members

NAME ID
BEYISA DEMISE 0721/14
THITINA ENDALE 3080/14
LELISA ABRAHAM 1969/14

Submitted to: Mr. Kiros


Submission date: 08/09/2016

1
TABLE CONTENTS
INTRODUCTION ………………………………………………………………………………….. Error!
Bookmark not defined.
1 what is cpu? …………………………………………………………………………………. ..... Error!
Bookmark not defined.
1 what is cpu? .............................................................................................................................................. 4
2. What is a microprocessor? ........................................................................................................................ 5
3. Instruction Set of 8086 ........................................................................................................................... 7
3.1 Data Transfer instruction ............................................................................................................... 7
3.2 Arithmetic Instructions .................................................................................................................... 8
3.3 Logical Instructions ........................................................................................................................ 10
3.4 Rotate Instructions ........................................................................................................................... 10
3.5 Shift Instructions .............................................................................................................................. 11
3.6 Branch Instructions .......................................................................................................................... 11
3.8 String Instructions ......................................................................................................................... 14
4. Types of Microprocessor............................................................................................................................. 15
4.1 CISC (Complex Instruction Set Computer) ............................................................................ 15
4.2 RISC (Reduced Instruction Set Computer) ............................................................................. 15
7.1 Data Bus: Role and Functions ...................................................................................................... 32
7.2 Address Bus: Its Importance in CPU ............................................................................................ 33
7.3 Control Bus: Managing CPU Activities........................................................................................ 33
7.4 The Role of Buses in CPU Function.................................................................................................. 34
7.5 Impact of Buses on CPU Performance ........................................................................................... 34
8. Random Access Memory (RAM) and Read Only Memory (ROM) ..................................................... 36
9
Reference……………………………………………………………………………………………………
…………………………43

2
INTRODUCTION

Central Processing Units are in nearly every electronic device on the market.

A microprocessor is more similar to a CPU than it is different. In fact, a CPU is often referred to
as a microprocessor. All CPUs are microprocessors, but not all microprocessors are CPUs.

Instructions are classified on the basis of functions they perform.

Instructions of this group perform addition, subtraction, multiplication, division, increment,


decrement, comparison, ASCII and decimal adjustment etc.

String is series of bytes or series of words stored in sequential memory locations.

There are three types of microprocessors namely, CISC, RISC, and EPIC.

Flip-flop is a circuit that maintains a state until directed by input to change the state.

Memory is the most essential element of a computing system because without it computer can‟t
perform simple tasks.

Random Access Memory (RAM) is a type of computer memory that is used to temporarily
store data that the computer is currently using or processing.

Read Only Memory (ROM) is a type of computer memory that is used to permanently store
data that does not need to be modified.

3
1 WHAT IS CPU?

 Central Processing Units are in nearly every electronic device on the market. Generally,
CPUs are discussed when talking about laptops and desktop computers. Although they
reside in almost all electronic devices, they become the center of conversations with
personal computers. Why? Perhaps because CPUs can be the difference between a fast or
slow or a good or bad computer in devices like this.

 A Central Processing Unit is generally described as the “brains” of a computer system. The
human brain is the central processing unit for our bodies and is responsible for receiving and
sending commands to other parts of our bodies; a CPU does the same thing, but instead of
sending messages over the nervous system, a CPU sends electrical messages with its
transistors over wires on a circuit board.

 For example, a computer will have memory slots for RAM storage, SATA ports for onboard
memory, and PCIe slots for peripherals like network/Wi-Fi cards, GPUs, and SSDs. Each of
these components helps with a different task. To complicate the situation, these components

4
also may communicate in a different computer language than the other. Although it seems
chaotic, the CPU is the system that brings order to the system; it is used to regulate and
translate communication to and from each component. When a key is pressed on a
keyboard, that action is translated into binary 1s and 0s, sent to the CPU, translated,
decoded, and processed by the CPU, then sent to be visualized on display. This is an
oversimplified example of what the CPU does in this specific scenario. Transactions like
this happen on the scale of billions of requests, messages, and commands per second.
 The primary purpose of a CPU is to relay communications to and from other components in
the system. The CPU performs basic arithmetic, logic control, and input/output operations
specified by the instructional program. Put more simply, the CPU is where all the central
processing is done and where all communication between different components happens.

 CPUs continue to grow in capability allowing them to process more information quicker.
Intel‟s first CPU in 1971 contained a total of 2,300 transistors whereas today the CPU in the
latest Xbox game system contains 5 billion transistors and the latest MacBook computers
with the M2 CPU contains a whopping 25 billion! Remind you, each transistor is capable of
processing a command; that means 25 billion commands can be processed in a single
second!

2. WHAT IS A MICROPROCESSOR?

A microprocessor is more similar to a CPU than it is different. In fact, a CPU is often


referred to as a microprocessor. All CPUs are microprocessors, but not all microprocessors

5
are CPUs.

A microprocessor consists of a central processor consisting of one or a few large-scale integrated


circuits. These circuits perform the functions of control components and arithmetic logic
components. The microprocessor can perform operations such as fetching instructions, executing
instructions, and exchanging information with external memory and logic components, and is an
arithmetic control part of the microcomputer. It can be combined with a memory and a peripheral
circuit chip to form a microcomputer.

On the other hand, a microprocessor: also known as a logic chip.It is essentially a single-chip
implementation of a CPU. A microprocessor contains all of a CPU's functions and can perform
arithmetic and logic operations with registers. However, a microprocessor's functions differ in
some ways to a CPU. For example, a microprocessor can add, subtract, compare and fetch
numbers within a system from one area to another.

When admins turn on a computer, the microprocessor receives the first instruction from the
BIOS. From there, the microprocessor either receives further instruction from the BIOS, the OS
the BIOS loads into the computer memory or an application that drives the microprocessor. In
modern IT, a majority of CPUs tend to be microprocessors by default because of their ability to
execute data movement, perform complex calculations and increase speed within a system.

The two main microprocessor vendors that garner significant popularity are Intel and Advanced
Micro Devices. Other microprocessors on the market include ARM.

 The final verdict: CPU vs. microprocessor


 Understanding the differences between CPUs and microprocessors can be difficult
because of their similarities. Many admins use CPU and microprocessor interchangeably,
but the reality is that while a CPU is essentially a microprocessor, not all microprocessors
are CPUs.

For example, many systems rely on GPUs, which are microprocessors that specialize in
rendering and managing images with the help of optimized geometric

6
3. Instruction Set of 8086

Instructions are classified on the basis of functions they perform. They are categorized into the
following main types:

3.1 Data Transfer instruction

All the instructions which perform data movement come under this category. The source data
may be a register, memory location, port etc. the destination may be a register, memory location
or port. The following instructions come under this category:

Instruction Description

MOV Moves data from register to register, register to memory, memory to register, memory
to accumulator, accumulator to memory, etc.

LDS Loads a word from the specified memory locations into specified register. It also loads
a word from the next two memory locations into DS register.

LES Loads a word from the specified memory locations into the specified register. It also
loads a word from next two memory locations into ES register.

LEA Loads offset address into the specified register.

LAHF Loads low order 8-bits of the flag register into AH register.

SAHF Stores the content of AH register into low order bits of the flags register.

XLAT/XLATB Reads a byte from the lookup table.

XCHG Exchanges the contents of the 16-bit or 8-bit specified register with the contents of AX
register, specified register or memory locations.

7
PUSH Pushes (sends, writes or moves) the content of a specified register or memory
location(s) onto the top of the stack.

POP Pops (reads) two bytes from the top of the stack and keeps them in a specified register,
or memory location(s).

POPF Pops (reads) two bytes from the top of the stack and keeps them in the flag register.

IN Transfers data from a port to the accumulator or AX, DX or AL register.

OUT Transfers data from accumulator or AL or AX register to an I/O port identified by the
second byte of the instruction.

3.2 Arithmetic Instructions

Instructions of this group perform addition, subtraction, multiplication, division, increment,


decrement, comparison, ASCII and decimal adjustment etc.

The following instructions come under this category:

Instruction Description

ADD Adds data to the accumulator i.e. AL or AX register or memory locations.

ADC Adds specified operands and the carry status (i.e. carry of the previous stage).

SUB Subtract immediate data from accumulator, memory or register.

SBB Subtract immediate data with borrow from accumulator, memory or register.

MUL Unsigned 8-bit or 16-bit multiplication.

IMUL Signed 8-bit or 16-bit multiplication.

8
DIV Unsigned 8-bit or 16-bit division.

IDIV Signed 8-bit or 16-bit division.

INC Increment Register or memory by 1.

DEC Decrement register or memory by 1.

DAA Decimal Adjust after BCD Addition: When two BCD numbers are added, the DAA is
used after ADD or ADC instruction to get correct answer in BCD.

DAS Decimal Adjust after BCD Subtraction: When two BCD numbers are added, the DAS is
used after SUB or SBB instruction to get correct answer in BCD.

AAA ASCII Adjust for Addition: When ASCII codes of two decimal digits are added, the
AAA is used after addition to get correct answer in unpacked BCD.

AAD Adjust AX Register for Division: It converts two unpacked BCD digits in AX to the
equivalent binary number. This adjustment is done before dividing two unpacked BCD
digits in AX by an unpacked BCD byte.

AAM Adjust result of BCD Multiplication: This instruction is used after the multiplication of
two unpacked BCD.

AAS ASCII Adjust for Subtraction: This instruction is used to get the correct result in
unpacked BCD after the subtraction of the ASCII code of a number from ASCII code
another number.

CBW Convert signed Byte to signed Word.

CWD Convert signed Word to signed Double word.

NEG Obtains 2's complement (i.e. negative) of the content of an 8-bit or 16-bit specified register
or memory location(s).

CMP Compare Immediate data, register or memory with accumulator, register or memory

9
location(s).

3.3 Logical Instructions

Instruction of this group perform logical AND, OR, XOR, NOT and TEST operations. The
following instructions come under this category:

Instruction Description

AND Performs bit by bit logical AND operation of two operands and places the result in the
specified destination.

OR Performs bit by bit logical OR operation of two operands and places the result in the
specified destination.

XOR Performs bit by bit logical XOR operation of two operands and places the result in the
specified destination.

NOT Takes one's complement of the content of a specified register or memory location(s).

TEST Perform logical AND operation of a specified operand with another specified operand.

3.4 Rotate Instructions

The following instructions come under this category:

Instruction Description

RCL Rotate all bits of the operand left by specified number of bits through carry flag.

RCR Rotate all bits of the operand right by specified number of bits through carry flag.

ROL Rotate all bits of the operand left by specified number of bits.

10
ROR Rotate all bits of the operand right by specified number of bits.

3.5 Shift Instructions

The following instructions come under this category:

Instruction Description

SAL or SHL Shifts each bit of operand left by specified number of bits and put zero in LSB position.

SAR Shift each bit of any operand right by specified number of bits. Copy old MSB into new
MSB.

SHR Shift each bit of operand right by specified number of bits and put zero in MSB position.

3.6 Branch Instructions

It is also called program execution transfer instruction. Instructions of this group transfer
program execution from the normal sequence of instructions to the specified destination or
target. The following instructions come under this category:

Instruction Description

JA or JNBE Jump if above, not below, or equal i.e. when CF and ZF = 0

JAE/JNB/JNC Jump if above, not below, equal or no carry i.e. when CF = 0

JB/JNAE/JC Jump if below, not above, equal or carry i.e. when CF = 0

JBE/JNA Jump if below, not above, or equal i.e. when CF and ZF = 1

JCXZ Jump if CX register = 0

11
JE/JZ Jump if zero or equal i.e. when ZF = 1

JG/JNLE Jump if greater, not less or equal i.e. when ZF = 0 and CF = OF

JGE/JNL Jump if greater, not less or equal i.e. when SF = OF

JL/JNGE Jump if less, not greater than or equal i.e. when SF ≠ OF

JLE/JNG Jump if less, equal or not greater i.e. when ZF = 1 and SF ≠ OF

JMP Causes the program execution to jump unconditionally to the memory address or
label given in the instruction.

CALL Calls a procedure whose address is given in the instruction and saves their return
address to the stack.

RET Returns program execution from a procedure (subroutine) to the next instruction
or main program.

IRET Returns program execution from an interrupt service procedure (subroutine) to the
main program.

INT Used to generate software interrupt at the desired point in a program.

INTO Software interrupts to indicate overflow after arithmetic operation.

LOOP Jump to defined label until CX = 0.

LOOPZ/LOOPE Decrement CX register and jump if CX ≠ 0 and ZF = 1.

LOOPNZ/LOOPNE Decrement CX register and jump if CX ≠ 0 and ZF = 0.

Here, CF = Carry Flag


ZF = Zero Flag
OF = Overflow Flag

12
SF = Sign Flag
CX = Register

3.7 Flag Manipulation and Processor Control Instructions

Instructions of this instruction set are related to flag manipulation and machine control. The
following instructions come under this category:

Instruction Description

CLC Clear Carry Flag: This instruction resets the carry flag CF to 0.

CLD Clear Direction Flag: This instruction resets the direction flag DF to 0.

CLI Clear Interrupt Flag: This instruction resets the interrupt flag IF to 0.

CMC This instruction take complement of carry flag CF.

STC Set carry flag CF to 1.

STD Set direction flag to 1.

STI Set interrupt flag IF to 1.

HLT Halt processing. It stops program execution.

NOP Performs no operation.

ESC Escape: makes bus free for external master like a coprocessor or peripheral device.

WAIT When WAIT instruction is executed, the processor enters an idle state in which the
processor does no processing.

LOCK It is a prefix instruction. It makes the LOCK pin low till the execution of the next
instruction.

13
3.8 String Instructions

String is series of bytes or series of words stored in sequential memory locations. The 8086
provides some instructions which handle string operations such as string movement, comparison,
scan, load and store.

The following instructions come under this category:

Instruction Description

MOVS/MOVSB/MOVSW Moves 8-bit or 16-bit data from the memory location(s) addressed by SI
register to the memory location addressed by DI register.

CMPS/CMPSB/CMPSW Compares the content of memory location addressed by DI register with the
content of memory location addressed by SI register.

SCAS/SCASB/SCASW Compares the content of accumulator with the content of memory location
addressed by DI register in the extra segment ES.

LODS/LODSB/LODSW Loads 8-bit or 16-bit data from memory location addressed by SI register
into AL or AX register.

STOS/STOSB/STOSW Stores 8-bit or 16-bit data from AL or AX register in the memory location
addressed by DI register.

REP Repeats the given instruction until CX ≠ 0

REPE/ REPZ Repeats the given instruction till CX ≠ 0 and ZF = 1

REPNE/REPNZ Repeats the given instruction till CX ≠ 0 and ZF = 0

14
4. Types of Microprocessor

Microprocessor

There are three types of microprocessors namely, CISC, RISC, and EPIC.

Before learning about them. Let us understand what is a microprocessor.

A microprocessor is basically the brain of the computer. We can also call it simply a processor
or CPU. Furthermore, a microprocessor is basically a computer processor that is mounted on a
single IC (Integrated Circuit). It means that all the functions of the processor are included on a
single chip. Furthermore, the basic task of a microprocessor is to input the instructions from
the memory, decode, and process them and produce the output. It performs three basic tasks
while processing the information.

 CISC, RISC, and EPIC

We have three basic types of microprocessors. They are as follows:

4.1 CISC (Complex Instruction Set Computer)

As the name suggests, the instructions are in a complex form. It means that a single instruction
can contain many low-level instructions.

For example loading data from memory, storing data to the memory, performing basic
operations, etc. Besides, we can say that a single instruction has multiple addressing modes.
Furthermore, as there are many operations in single instruction they use very few registers.

Examples of CISC are Intel 386, Intel 486, Pentium, Pentium Pro, Pentium II, etc.

4.2 RISC (Reduced Instruction Set Computer)

As per the name, in this, the instructions are quite simple, and hence, they execute quickly.
Moreover, the instructions get complete in one clock cycle and also use a few addressing modes
only. Besides, it makes use of multiple registers so that interaction with memory is less.

15
Examples are IBM RS6000, DEC Alpha 21064, DEC Alpha 21164, etc.

4.3 EPIC (Explicitly Parallel Instruction Computing)

It allows the instructions to compute parallelly by making use of compilers. Moreover, the
complex instructions also process in fewer clock frequencies. Furthermore, it encodes the
instructions in 128-bit bundles.

Where each bundle contains three instructions encoded in 41 bits each and a 5-bit template. This
5-bit template contains information about the type of instructions and that which instructions can
be executed in parallel.

Examples are IA-64 (Intel Architecture-64), etc.

 Characteristics of CISC, RISC

Characteristics of CISC are as follows:

 As the instructions are complex hence, the decoding of instructions is also complex.
 The size of instructions is greater than the one-word size.
 Instruction can take more than one clock cycle to execute.
 The number of registers is less since most of the operations are performed in memory
itself.
 The address modes are also complex.
 Data types are more in number.

 Characteristics of RISC are as follows:

 As the instruction is simple hence, the decoding of instructions is also simple.

 The size of instructions is under the one-word size.

 Instruction takes one clock cycle to execute.

 The number of registers is more.

 The address modes are also simple.


16
 Data types are less in number.

 Can be used for pipelining.

 Advantages of CISC, RISC

Advantages of CISC are as follows:

 Microprogramming in CISC is as easy as the assembly language implementation.


 The number of instructions for performing operations is less in number. Hence, the
memory usage is low. Moreover, time consumption is also less.
 Advantages of RISC are as follows:
 Instructions are simple hence easy to understand and decode.
 The instructions complete in one clock cycle therefore, CPU can handle multiple
instructions at a time.

RISC CISC

 It focuses on the  It focuses on the


software. hardware.

 It uses a hardwired as
 Uses the hardwired
well as a micro
control unit.
programmed control unit.

 Transistors are used for


 Uses transistors for more
storing the complex
registers.
instructions.

 The instructions have a  The size of instructions


fixed size. vary.

 It performs only register  Besides the register to

17
to register arithmetic register operations, it can
operations. also perform register to
memory or memory to
register operations.

 It requires more number


 Fewer registers are used.
of registers.

 Multiple operations are


 As the instructions are
present in single
individual the code is
instruction hence, the
large.
code is small.

 Executes in one clock  Takes more than one


cycle. clock cycle for execution.

 The size of instructions is


 Instructions have a size
greater than the one-word
of one word.
size.

 Examples are IBM  Examples of CISC are


RS6000, DEC Alpha Intel 386, Intel 486,
21064, DEC Alpha Pentium, Pentium Pro,
21164, etc. Pentium II, etc.

5. Flag register in 8085 microprocessor

Prerequisite – Registers of 8085 microprocessor The Flag register is a Special Purpose Register.
Depending upon the value of the result after any arithmetic and logical operation, the flag bits
become set (1) or reset (0). In 8085 microprocessor, the flag register consists of 8 bits and only 5
of them are useful. The 5 flags are:

18
1. Sign Flag (S) – After any operation if the MSB (B(7)) of the result is 1, it indicates the
number is negative and the sign flag becomes set, i.e. 1. If the MSB is 0, it indicates the
number is positive and the sign flag becomes reset i.e. 0. from 00H to 7F, sign flag is 0
from 80H to FF, sign flag is 1 1- MSB is 1 (negative) 0- MSB is 0 (positive)
Example: MVI A 30 (load 30H in register A) MVI B 40 (load 40H in register B) SUB B
(A = A – B) These set of instructions will set the sign flag to 1 as 30 – 40 is a negative
number. MVI A 40 (load 40H in register A) MVI B 30 (load 30H in register B) SUB B
(A = A – B) These set of instructions will reset the sign flag to 0 as 40 – 30 is a positive
number.
2. Zero Flag (Z) – After any arithmetical or logical operation if the result is 0 (00)H, the
zero flag becomes set i.e. 1, otherwise it becomes reset i.e. 0. 00H zero flags is 1. from
01H to FFH zero flag is 0 1- zero-result 0- non-zero result Example: MVI A 10 (load
10H in register A) SUB A (A = A – A) These set of instructions will set the zero flag to 1
as 10H – 10H is 00H
3. Auxiliary Carry Flag (AC) – This flag is used in the BCD number system(0-9). If after
any arithmetic or logical operation D(3) generates any carry and passes it on to D(4) this
flag becomes set i.e. 1, otherwise, it becomes reset i.e. 0. This is the only flag register that
is not accessible by the programmer 1-carry out from bit 3 on addition or borrows into bit
3 on subtraction 0-otherwise
Example: MVI A 2BH (load 2BH in register A) MVI 39H (load 39H in register B) ADD
B (A = A + B) These set of instructions will set the auxiliary carry flag to 1, as on adding
2B and 39, the addition of lower-order nibbles B and 9 will generate a carry.
4. Parity Flag (P) – If after any arithmetic or logical operation the result has even parity, an
even number of 1 bit, the parity register becomes set i.e. 1, otherwise it becomes reset i.e.
0. 1-accumulator has an even number of 1 bits 0-accumulator has odd parity
Example: MVI A 05 (load 05H in register A) This instruction will set the parity flag to 1
as the BCD code of 05H is 00000101, which contains an even number of ones i.e. 2.
5. Carry Flag (CY) – Carry is generated when performing n bit operations and the result is
more than n bits, then this flag becomes set i.e. 1, otherwise, it becomes reset i.e. 0.
During subtraction (A-B), if A>B it becomes reset, and if (A<B) it becomes set. Carry
flag is also called the borrow flag. 1-carry out from MSB bit on addition or borrow into
MSB bit on subtraction 0-no carry out or borrow into MSB bit.
Example: MVI A 30 (load 30H in register A) MVI B 40 (load 40H in register B) SUB B
(A = A – B) These set of instructions will set the carry flag to 1 as 30 – 40 generates a
carry/borrow. MVI A 40 (load 40H in register A) MVI B 30 (load 30H in register B)
SUB B (A = A – B) These set of instructions will reset the carry flag to 0 as 40 – 30 does
not generate any carry/borrow.

19
Advantages:

Efficient error detection: The flag register can be used to efficiently detect errors and other
conditions during program execution. For example, the carry flag can be used to detect overflow
or underflow during arithmetic operations..

Disadvantages:

Limited information: The flag register provides a limited set of status information that may not
be sufficient for all applications.

Limited control: The flags in the flag register are set or cleared automatically by the processor
and cannot be directly manipulated by the programmer.

Complexity: The use of flags can add complexity to programming and debugging, particularly
when multiple flags are used in conjunction with one another.

Overwriting: Since the flag register is also used for other purposes, such as storing the stack
pointer, the status flags can be accidentally overwritten during program execution.

6. Flip-flop types, their Conversion and Applications

Flip-flop is a circuit that maintains a state until directed by input to change the state. A basic flip-
flop can be constructed using four-NAND or four-NOR gates. Flip flop is popularly known as
the basic digital memory circuit. It has its two states as logic 1(High) and logic 0(low) states. A
flip flop is a sequential circuit which consists of single binary state of information or data. The
digital circuit is a flip flop which has two outputs and are of opposite states. It is also known as a
Bistable Multivibrator.

Types of flip-flops:

 Flip Flop
 SR JK Flip Flop
 D Flip Flop
 T Flip Flop

Logic diagrams and truth tables of the different types of flip-flops are as follows:

20
I. S-R Flip Flop:

In the flip flop, with the help of preset and clear when the power is switched ON, the states of the
circuit keeps on changing, that is it is uncertain. It may come to set(Q=1) or reset(Q‟=0) state. In
many applications, it is desired to initially set or reset the flip flop that is the initial state of the
flip flop that needs to be assigned. This thing is accomplished by the preset (PR) and the
clear(CLR).

21
Operations:

Case 1:

PR=CLR=1 The asynchronous inputs are inactive and the flip flop responds freely to the S,R and
the CLK inputs in the normal way.

Case 2:

PR=0 and CLR=1 This is used when the Q is set to 1.

Case 3:

PR=1 and CLR=0 This is used when the Q‟ is set to 1.

Case 4:

PR=CLR=0 This is an invalid state.

22
II. J-K Flip Flop:

In JK flip flops, the diagram over here represents the basic structure of the flip flop which
consists of Clock (CLK), Clear (CLR), Preset (PR).

23
Operations:

Case 1:

PR=CLR=0 This condition is in its invalid state.

Case 2:

PR=0 and CLR=1 The PR is activated which means the output in the Q is set to 1. Therefore, the
flip flop is in the set state.

Case 3:

PR=1 and CLR=0 The CLR is activated which means the output in the Q‟ is set to 1. Therefore,
the flip flop is in the reset state.

Case 4:

PR=CLR=1 In this condition the flip flop works in its normal way whereas the PR and CLR gets
deactivated.

24
Race around condition:
When the J and K both are set to 1, the input remains high for a longer duration of time, then the
output keeps on toggling. Toggle means that switching in the output instantly i.e. Q=0, Q‟=1 will
immediately change to Q=1 and Q‟=0 and this continuation keeps on changing. This change in
output leads to race around condition.

Characteristics Equation for JK Flip Flop: QN+1 = JQ‟N + K‟QN

D Flip Flop.

Characteristics Equation for D Flip Flop: QN+1 = D

25
I V T Flip Flop:

T FLIP FLOP

Characteristics Equation for T Flip Flop: QN+1 = Q‟NT + QNT‟ = QN XOR T

Conversion for Flip Flops:

26
EXCITATION TABLE:

Steps To Convert from One Flip Flop to Other:


Let there be required flip flop to be constructed using sub-flipflop:

1. Draw the truth table of the required flip-flop.


2. Write the corresponding outputs of sub-flip flop to be used from the excitation table.
3. Draw K-Maps using required flip flop inputs and obtain excitation functions for sub-flip
flop inputs.
4. Construct a logic diagram according to the functions obtained.

i) Convert SR To JK Flip Flop

27
Excitation Functions:

28
ii) Convert SR To D FlipFlop:

Excitation Functions: S = D, R = D„

Applications of Flip-Flops:

These are the various types of flip-flops being used in digital electronic circuits and the
applications of Flip-flops are as specified below.
 Counters
 Frequency Dividers
 Shift Registers

29
 Storage Registers
 Bounce elimination switch
 Data storage
 Data transfer
 Latch
 Registers
 Memory

 Microprocessor Applications

A microprocessor makes daily life easier because of its low cost, low power, small weight, and
vast application in every field. There are several applications of microprocessors. Some of the
important applications are:

 Household Devices

o The programmable thermostat allows the control of temperature at homes. In this


system, a microprocessor works with the temperature sensor to determine and adjust the
temperature accordingly.
o High-end coffee makers, Washing machines, and radio clocks contain microprocessor
technology.
o Some other home items that contain microprocessors are: microwaves, toasters,
televisions, VCRs, DVD players, ovens, stoves, clothes washers, stereo systems, home
computers, alarm clocks, hand-held game devices, thermostats, video game systems,
bread machines, dishwashers, home lighting systems and even some refrigerators with
digital temperature control.

 Industrial Applications of Microprocessors

o Some industrial items which use microprocessors technology include: cars, boats, planes,
trucks, heavy machinery, elevators, gasoline pumps, credit-card processing units, traffic
control devices, computer servers, most high tech medical devices, surveillance systems,
security systems, and even some doors with automatic entry.

30
 Transportation Industry

o Automobiles, trains and planes also use microprocessor technology.


o Consumer vehicles-buses, cars, trucks -integrate microprocessors to communicate
important information throughout the vehicle. E.g., navigation systems provide
information using microprocessors and global positioning system (GPS) technology.

 Computers and Electronics

o Microprocessor-drives technology is the brain of the computer. They are used in all type
of computers ranging from microcomputers to supercomputers.
o A cell phone or mobile device executes game instructions by way of the microprocessor.
o VCRs, televisions and gaming platforms also contain microprocessors for executing
complex instructions and tasks.

 In Medicals
o Many medical devices, like an insulin pump, are typically controlled by a
microprocessor. The microprocessors perform various functions, such as processing data
from bio-sensors, storing measurements, and analyzing results.

 Instrumentation

o Microprocessor is also very useful in the field of instrumentation. Function generators,


frequency counters, frequency synthesizers, spectrum analyses and many other
instruments are available, when microprocessors are used as controller.

 Entertainment

o The use of microprocessor in entertainment equipment, toys and home entertaining


applications is making them more useful and full of features.

 Embedded Systems at Home

o A number of modern devices in the home are microprocessor based i.e. camera; washing
machines; calculators; hi-fi systems; telephones; microwave ovens; burglar alarms etc.

31
The input are usually simple numeric keyboards, sensors, buttons or while the output
include lights, simple LCD screens displays, motors and relays, LEDs, buzzers etc.

 Office Automation and Publication

 Microprocessor based system with software packages has changed the office
environment. Microprocessors based systems are being used for spread sheet operations,
word processing, storage etc.
 The Publication technology has revolutionized by the microprocessor.

 Communication

o In communication the telephone industry is most important. In this industry,


microprocessors are used in digital telephone sets, telephone exchanges and modem etc.
o The use of microprocessor in satellite communication, television, has made
teleconferencing possible.
o Railway reservation and airline reservation system also uses microprocessor technology.
WAN (Wide Area Network) and LAN (Local Area Network) for communication of
vertical information through computer network.

7. Types of CPU Buses

In computer systems, different types of buses are responsible for coordinating and facilitating
communication between the Central Processing Unit (CPU) and other components. Focusing on
the three most critical buses - Data Bus, Address Bus, and Control Bus - will help deepen your
understanding of CPU functionality and processor architecture.

7.1 Data Bus: Role and Functions

The Data Bus performs a pivotal role in transmitting information between various parts of the
computer system. It is responsible for carrying data to and from the CPU, memory, and I/O
devices. The Data Bus is a bidirectional communication path, meaning it allows data transfer in
both directions. As a result, the CPU can read from or write to memory and I/O devices.

The width of a Data Bus, expressed in bits, determines how much data it can transfer
simultaneously. For instance, an 8-bit Data Bus can carry 8 bits of data at a time, while a 32-bit
Data Bus can carry 32 bits of data. The data transfer rate depends on the bus width and the
system's clock speed, and is usually measured in Mega Transfers per Second (MT/s).

32
The Data Bus undertakes several crucial functions, such as:

 Transferring data between the CPU and memory during read and write
operations.
 Carrying data between the CPU and I/O devices, enabling input/output
communication and device control.
 Allowing the sharing of data and resources among interconnected devices in
a multi-processor or multi-core environment.

7.2 Address Bus: Its Importance in CPU

The Address Bus plays a vital role in pinpointing the exact location of memory cells or I/O
device registers that the CPU needs to access. It is a unidirectional communication line, meaning
it only carries information in one direction – from the CPU to the memory or input/output
devices.

The width of the Address Bus, expressed in bits, establishes the maximum number of unique
addresses the CPU can

Enables the CPU to access and communicate with specific memory cells and I/O device
registers.

Provides a high level of granularity and control over memory allocation and resource
management within the computer system.

Facilitates memory mapping and address translation, allowing the CPU to interact efficiently
with different types of memory and physical devices.

7.3 Control Bus: Managing CPU Activities

The Control Bus is responsible for transmitting control signals that orchestrate and regulate data
flow and overall system operation. These control signals relay commands and status information
between the CPU and other components, such as memory and I/O devices. As a result, the
Control Bus coordinates the activities of computer hardware and maintains the proper
functioning of the system.

Control signals transmitted by the Control Bus can be divided into three categories, including:

 Memory Access Signals: These signals, such as memory read and memory write, manage
the access and storage of data in memory.
 Input/ Output Access Signals: Signals like I/O read and I/O write control the flow of data
between the CPU and I/O devices.

33
 Status and Synchronization Signals: These signals, such as bus request, bus grant, and
interrupt request, coordinate system activities and ensure proper communication between
components.

 Some essential functions of the Control Bus include:

 Coordinating and synchronizing communication between the CPU, memory, and I/O
devices by transmitting the appropriate control signals.
 Managing interrupts and exceptions, enabling the CPU to handle higher-priority tasks and
errors promptly.
 Ensuring the proper flow of data across the system by controlling memory and I/O access
during read and write operations.

In conclusion, the Data Bus, Address Bus, and Control Bus are intricately interconnected in
facilitating communication and coordinating operations within the CPU. Gaining a
comprehensive understanding of these buses is essential for mastering computer architecture and
excelling in the field of computer science.

7.4 The Role of Buses in CPU Function

Buses within the Central Processing Unit (CPU) are fundamental components that contribute to
establishing seamless communication and data transfer between various parts of a computer
system. They ensure efficient transmission of data, address, and control signals between the
CPU, memory,

7.5 Impact of Buses on CPU Performance

Buses have a massive influence on the overall performance of a CPU. They impact data transfer
rates, memory addressing capabilities, and the coordination of specific operations. These various
factors combine to impact the speed and efficiency with which a CPU can perform tasks.

 Data Bus width and its impact on CPU performance:

34
 A wider Data Bus ensures quicker data transfer rates, as it can simultaneously handle
more bits of data between the CPU, memory, and I/O devices. Consequently, this serves
to improve the overall throughput and performance of the CPU.
 A narrow Data Bus might limit data transfer capabilities and hence affect CPU
performance. In such cases, the CPU might have to break down tasks into multiple
smaller operations, which might result in diminished efficiency.

 Address Bus width and its effect on memory addressing:

 The width of the Address Bus directly determines the maximum amount of memory that
can be addressed by the CPU. This is essential as it influences the system's ability to
access and manage large amounts of data and resources efficiently.
 A narrower Address Bus will restrict the amount of addressable memory and could have
a limiting effect on the efficiency and available resources in the system. This might result
in reduced performance when dealing with large datasets and intensive tasks.

 Control Bus signals and their role in CPU operations:

 The Control Bus communicates and coordinates various operations between the CPU,
memory, and I/O devices. These control signals ensure smooth functionality and proper
data flow within the system.
 Efficient control signal management is essential for CPU performance. Delays and
inefficiencies in the Control Bus can lead to performance bottlenecks, backlogs in
operation queues, and reduced throughput.

 Communication between CPU and Memory

Effective communication between the CPU and memory is imperative for a computer system's
optimal functioning. This communication is facilitated by the Data Bus, Address Bus, and
Control Bus, which coordinate data transmission, memory addressing, and overall operation
management, respectively.

Here is a step-by-step guide to the process of communication between CPU and memory:

35
1. The CPU generates a memory address and places it on the Address Bus, indicating the
specific memory location it intends to access.
2. Alongside this, the Control Bus transmits memory access signals, such as Memory Read
or Memory Write, to manage data access and storage in memory.
3. If a Memory Read operation is being performed, the memory component responds by
placing the requested data on the Data Bus, and the CPU receives this data for
processing.
4. Conversely, for a Memory Write operation, the CPU places the data to be written on the
Data Bus, allowing the memory component to receive

Interfacing with External Devices


A core aspect of a computer system's functionality is its ability to interface with external devices,
such as keyboards, mice, and printers. The CPU is responsible for coordinating communication
with these input/output (I/O) devices through a combination of Data Bus, Address Bus, and
Control Bus signals.

Here are some key aspects of interfacing with external devices:

The Address Bus assigns unique addresses to I/O device registers, allowing the CPU to reference
and interact specifically with each I/O device.

The Control Bus transmits I/O access signals (I/O Read and I/O Write) for managing data flow
between the CPU and I/O devices during input and output operations.

8. Random Access Memory (RAM) and Read Only Memory (ROM)


Random Access Memory (RAM) is a type of computer memory that is used to temporarily
store data that the computer is currently using or processing. RAM is volatile memory, which
means that the data stored in it is lost when the power is turned off. RAM is typically used to
store the operating system, application programs, and data that the computer is currently using.

Read Only Memory (ROM) is a type of computer memory that is used to permanently store
data that does not need to be modified. ROM is non-volatile memory, which means that the data
stored in it is retained even when the power is turned off. ROM is typically used to store the
computer‟s BIOS (basic input/output system), which contains the instructions for booting the
computer, as well as firmware for other hardware devices.

Types of Memory

Memory is the most essential element of a computing system because without it computer can‟t
perform simple tasks. Both types of memory (RAM and ROM) are important for the computer,
but they serve different purposes. RAM is used to store data that the computer is currently using,

36
while ROM is used to store data that the computer needs to boot and operate. RAM is faster than
ROM, as the data stored in it can be accessed and modified in any order, while data stored in
ROM can only be read.

 Computer memory is of two basic types:


1. Primary memory (RAM and ROM)
2. Secondary memory (Hard Drive, CD, etc).

Classification of Primary Memory

 Random Access Memory (RAM)


 It is also called read-write memory or the main memory or the primary memory.
 The programs and data that the CPU requires during the execution of a program are stored in
this memory.
 It is a volatile memory as the data is lost when the power is turned off.

37
Read Only Memory

Types of Random Access Memory (RAM)

 Static RAM (SRAM)


 Dynamic RAM (DRAM)
1. Static RAM: SRAM stands for Static Random Access Memory. It is a type of semiconductor
which is widely used in computing devices and microprocessors.
2. Dynamic RAM: DRAM stands for Dynamic Random Access Memory. It is made of
Capacitors and has smaller data life span than Static RAM.

38
Difference between SRAM and DRAM

Advantages of Random Access Memory (RAM)


Speed: RAM is much faster than other types of storage, such as a hard drive or solid-state drive,
which means that the computer can access the data stored in RAM more quickly.

Flexibility: RAM is volatile memory, which means that the data stored in it can be easily
modified or deleted. This makes it ideal for storing data that the computer is currently using or
processing.

Capacity: The capacity of RAM can be easily upgraded, which allows the computer to store
more data in memory and thus improve performance.

Power Management: RAM consumes less power compared to hard drives, and solid-state
drives, which makes it an ideal memory for portable devices.

Disadvantages of Random Access Memory (RAM)

Volatility: RAM is volatile memory, which means that the data stored in it is lost when the
power is turned off. This can be a problem for important data that needs to be preserved, such as
unsaved work or files that have not been backed up.

39
Capacity: The capacity of RAM is limited, and although it can be upgraded, it may still not be
sufficient for certain applications or tasks that require a lot of memory.

Cost: RAM can be relatively expensive compared to other types of memory, such as hard drives
or solid-state drives, which can make upgrading the memory of a computer or device more
costly.

Read-Only Memory (ROM)


Stores crucial information essential to operate the system, like the program essential to boot the
computer.

It is non-volatile.

Always retains its data.

Used in embedded systems or where the programming needs no change.

Used in calculators and peripheral devices.

ROM is further classified into four types- MROM, PROM, EPROM, and EEPROM.

40
 Types of Read-Only Memory (ROM)
PROM (Programmable Read-Only Memory)

EPROM (Erasable Programmable Read Only Memory)

EEPROM (Electrically Erasable Programmable Read Only Memory)

MROM (Mask Read Only Memory)

1. PROM (Programmable read-only memory): It can be programmed by the user. Once


programmed, the data and instructions in it cannot be changed.

2. EPROM (Erasable Programmable read-only memory): It can be reprogrammed. To erase


data from it, expose it to ultraviolet light. To reprogram it, erase all the previous data.

3. EEPROM (Electrically erasable programmable read-only memory): The data can be


erased by applying an electric field, with no need for ultraviolet light. We can erase only portions
of the chip.

4. MROM(Mask ROM): Mask ROM is a kind of read-only memory, that is masked off at the
time of production. Like other types of ROM, mask ROM cannot enable the user to change the
data stored in it. If it can, the process would be difficult or slow.

 Advantages of Read Only Memory (ROM)

 Non-volatility: ROM is non-volatile memory, which means that the data stored in it is
retained even when the power is turned off. This makes it ideal for storing data that does not
need to be modified, such as the BIOS or firmware for other hardware devices.
 Reliability: Because the data stored in ROM is not easily modified, it is less prone to
corruption or errors than other types of memory.
 Power Management: ROM consumes less power compared to other types of memory,
which makes it an ideal memory for portable devices.

 Disadvantages of Read Only Memory (ROM)

 Limited Flexibility: ROM is read-only memory, which means that the data stored in it
cannot be modified. This can be a problem for applications or firmware that need to be
updated or modified.
 Limited Capacity: The capacity of ROM is typically limited, and upgrading it can be
difficult or expensive.

41
 Cost: ROM can be relatively expensive compared to other types of memory, such as hard
drives or solid-state drives, which can make upgrading the memory of a computer or device
more costly.
Difference between RAM and ROM

42
REFERENCES

https://www.techtarget.com
https://www.totalphase.com
https://www.quora.com/
https://redkiwiapp.com/
https://www.geeksforgeeks.org/
https://www.tutorialspoint.com
https://www.javatpoint.com

43

You might also like