0% found this document useful (0 votes)
82 views

Comparison Between MPU - Computer - MCU

1) A microprocessor is an electronic chip that serves as the central processing unit (CPU) of computers and other electronic devices. It takes input, processes it, and provides output. 2) Microprocessors are used in two main applications - personal computers and microcontrollers (or embedded systems). Personal computers can run various programs while microcontrollers are programmed to perform dedicated tasks in devices. 3) The basic components of a computer system are the arithmetic logic unit (ALU), memory, control unit, input unit, and output unit. The control unit directs the other units to process data stored in memory as programmed.

Uploaded by

Patrick Serandon
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)
82 views

Comparison Between MPU - Computer - MCU

1) A microprocessor is an electronic chip that serves as the central processing unit (CPU) of computers and other electronic devices. It takes input, processes it, and provides output. 2) Microprocessors are used in two main applications - personal computers and microcontrollers (or embedded systems). Personal computers can run various programs while microcontrollers are programmed to perform dedicated tasks in devices. 3) The basic components of a computer system are the arithmetic logic unit (ALU), memory, control unit, input unit, and output unit. The control unit directs the other units to process data stored in memory as programmed.

Uploaded by

Patrick Serandon
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/ 12

COMPARISON BETWEEN COMPUTER, MICROCOMPUTER & MICROPROCESSOR

Definition of Microprocessor

A microprocessor is a tiny electronic chip found inside a computer's central processing unit,
microcontroller unit and other electronic devices. Its basic function is to take input, process it and then
provide appropriate output.

2 branches of applications:
1. Personal Computer – These microprocessor-based computers were intended to be versatile
tools that could load and run various programs such as word processor, spreadsheets, database
and games. They could also be easily custom-programmed by the user to do whatever the
programmer imagined. (Example : Intel 4004, and the likes)
2. Microcomputer (or Microcontroller unit) – A microprocessor-based computer as a control unit
embedded in a marketable product. These microcomputer is made up of the same elements as
the personal computer, but it is programmed once by the manufacturer. Then it spends its life
performing its intended tasks, such as waiting for buttons to be pressed and turning ON & OFF
devices such as lights, motors, beepers, etc.( Example: Intel 8051 family)

Intel 8051 – reperesent a branch of the microprocessor family tree


- Falls into general category known as embedded microcontrollers
- First developed in the early 1980s along with 68HCII
- 8 bit control-oriented device

Digital computer – is a combination of digital device and circuits that can perform a programmed
sequence of operations with a minimum of human intervention.
- Is simply a high-speed machine that can manipulate data, solve problems, , and make
decisions, all under the control of the program.

Program – sequence of operations


- Is a set of coded instructions that is stored in the computer’s internal memory along with
all of the data that the program requires.

Computer programmer – provides a program of instructions and data that specifies every detail of
what to do, what to do it and when to do it.

SECRET AGENT 89
- A far-fetched analogy that contains many concepts involved in computer operation.

Mission: Secret agent 89 is trying to find out the number of the airport landing strip where a known
terrorist will be landing.

Background: His contact tells him that the information is located in a series of post office boxes. To
ensure that no one else gets the information, it is spread through 10 different boxes. His contact gives
him 10 keys along with the following instructions:
1. The information in each box is written in code.
2. Open box 1 first and execute the instruction located there.
3. Continue through the rest of the boxes in sequence unless instructed to do otherwise.
4. One of the boxes contains information that will misdirect anyone but Agent 89.

1
1) Add the number stored in box 9 to your 2) Divide the previous result by the number
secret agent code number stored in box 10
3) Subtract the number stored in box 8 4) If the previous result is not equal to 30, go
to box 7. Otherwise continue to next box.
5) Subtract 13 from the previous result. 6) Return to headquarters for more
instructions.
7) The landingwill take place on strip #3 8) 20
9) 11 10) 2

When compared to computer operation:


Memory (where instructions and data are stored) – post office boxes
Memory Addresses – numbers on each box
Instructions - boxes 1,2,3,4,5,&6
Data – boxes 8,9,& 10

Different classes of instructions are present in boxes 1 to 6:


Boxes 1, 2, 3 & 5 – are instructions that call for arithmetic operations.
Box 4 – contains a decision-making instruction called a conditional jump or conditional branch (This
instruction calls for the agent or computer to decide whether to jump to address 7 or continue to
address 5)
Box 6 – contains a simple control instruction that requires no data and refers to no other addresses (or
box #). This return instruction tells the agent that the procedure is finished (or the program is
completed)

Note: A computer like secret agent 89, decode and then execute the instructions stored in memory
sequentially, beginning with the first location.

BASIC COMPUTER SYSTEM ORGANIZATION

Five essential elements in every computer:


1. Arithmetic/Logic Unit (ALU)
2. Memory unit
3. Control Unit
4. Input Unit
5. Output Unit

Figure: basic computer organization ( see fig at the board)

Arrows – indicate the direction in which data, information, or control signals are flowing.
2 different-size arrows:
1. Larger arrows – represent data or information that consists of large number of parallel lines
2. Smaller arrows – represent control signals that are normally only one or a few lines.

Arithmetic/Logic Unit (ALU)


The ALU is the area of the computer in which arithmetic and logic operations are performed on data.
The type of operation that is to be performed is determined by signals from the control unit( arrow 1).
The data to be operated on by ALU can come from either the memory unit (arrow 2) or the input unit(
arrow 3). Results of operations performed in the ALU can be transferred to either the memory unit for
storage (arrow 4) or the output unit (arrow 5)

2
Memory Unit
The memory stores groups of binary digits(word) that can represent instructions ( program) that the
computer is to perform and the data that are to be operated on by the program. The memory also
serves as storage for intermediate and final results of arithmetic operation (arrow 4). Operation of the
memory is controlled by the control unit (arrow 6), which signals for either a read or a write operation. A
given location in memory is accessed by the control unit that provides the appropriate address
code(arrow 7). Information can be written into the memory from the ALU or the input unit (arrow 8),
again under control of the control unit. Information can be read from memory into the ALU (arrow 2 ) or
into the output unit ( arrow 9).

Input Unit
The input unit consists of all of the devices used to take information and data that are external to the
computer and put them into the memory unit (arrow 8 ) or the ALU (arrow 3). The control unit
determines where the input information is sent ( arrow 10). The input unit is used to to enter the
program and data into the memory unit prior to starting the computer. This unit is also used to enter
data into the ALU from an external device during the execution of a program. Some of the common
input devices are keyboard, toggle switches, modems, magnetic-strip reader, magnetic disc units,
magnetic tape units, analog-to-digital converter(ADC), etc.

Output Unit
The output unit consists of the devices used to transfer data and information from the computer to the
“outside world”. The output devices are directed by the control unit (arrow 12) and can receive data
from memory (arrow 9) or the ALU (arrow 5); the data are then put into appropriate form for external
use. Example of common output devices are LED readouts, indicator lights, printers, disk or tape units,
video monitors, and DAC(digital-to-analog converter).

Control Unit
It directs the operation of all of the other units by providing timing and control signals. This unit contains
logic and timing circuits that generate the proper signals necessary to execute each instruction in a
program.
The control unit fetches an instruction from memory by sending an address (arrow7) and a read
command (arrow 6) to the memory unit. The instruction word stored at the memory location is then
transferred to the control unit (arrow 11).

Computer Interfacing – transmitting digital information between a computer and its peripherals in a
compatible and synchronized way.

Peripherals – the devices that make up the input and output units because they are external to the rest
of the computer.

Central Processing Unit

Pronounced as separate letters, CPU is the abbreviation for central processing unit. Sometimes referred
to simply as the central processor, but more commonly called processor, the CPU is the brains of
the computer where most calculations take place. In terms of computing power, the CPU is the most
important element of a computer system.
On large machines, the CPU requires one or more printed circuit boards. On personal computers and
small workstations, the CPU is housed in a single chip called a microprocessor. Since the 1970's the
microprocessor class of CPUs has almost completely overtaken all other CPU implementations.

3
The CPU itself is an internal component of the computer. Modern CPUs are small and square and
contain multiple metallic connectors or pins on the underside. The CPU is inserted directly into a CPU
socket, pin side down, on the motherboard.

BASIC MICROCOMPUTER ELEMENTS

The difference between microcomputer and microprocessor are:


1. A microcomputer contains several elements, the most important of which is the microprocessor.
2. The microprocessor is usually a single IC that contains all of the circuitry of the control and ALU-
in other words, the CPU.
Microprocessor – commonly refer as the Microprocessor Unit(MPU), since it is the CPU( control
processing Unit) of the microcomputer

Memory Unit
clocks
RAM ROM

Input Output
Microprocessor(
Interface Interface
MPU)
Input Output
Device Device

Input Unit Output Unit


CPU

basic elements of a microcomputer

Memory unit – consist of RAM and ROM.


RAM section (software) – consist of one or more LSI chips arranged to provide the designed memory
capacity.
-is used to store programs and data, which will change often during the course of
operation.
-it is also used as storage for intermediate and final results of operations performed
during execution of a program.
ROM (firmware) section – contains one or more ROM chips to store instructions and data that do not
change and must not be lost when power is shut off.

Input/ output section – contain the interface circuits needed to allow the peripherals to communicate
properly with the rest of the computer.

Input/output interface circuits – in some cases, are LSI chips designed by the MPU manufacturer to
interface the MPU to a variety of I/O devices. In other cases, the interface circuits may be a simple as a
buffer register.

Embedded control application: all of the basic elements of a microcomputer are integrated into a single
IC known as the “single-chip microcomputer”.

4
THE MICROPROCESSOR (MPU)
The MPU is the heart of every microcomputer (or microcontroller). It performs a number of functions,
including:
1. Providing timing and control signals for all elements of the microcomputer
2. Fetching instructions and data from memory
3. Transferring data to and from memory and I/O devices
4. Decoding instructions
5. Performing arithmetic and logic operations called for by instructions
6. Responding to I/O-generated control signals such as RESET and INTERRUPT

The MPU contains all of the logic circuitry for performing these functions, but its internal logic is
generally not externally accessible. Instead, we can control what happens inside the MPU by the
program of instructions that we put in memory for the MPU to execute, that makes the MPU so versatile
and flexible.
Example: When we want to change its operation, we simply change the programs stored in RAM
(software) or ROM(firmware) rather than rewire the electronics(hardware).

Three basic sections of MPU:


1. The control and timing section
2. The register section
3. The ALU section

A
DPTR R7 Address Bus
R6
Register R5
ALU
section
R0 Data Bus
PC
IR
Control and Timing Circuit Control Bus
Major functional areas of Microprocessor

Timing and control section


- to fetch and decode (Interpret) instruction codes from program memory, and then to
generate the necessary control signals required by the other MPU sections in order to
carry out the execution of the instructions.
- Also generates timing and control signal (example: R/W, clock) that are needed by
external RAM, ROM, and I/O devices.

Register section

- Contains various registers (inside the MPU), each of which performs a special function.

Program Counter – the most important register that keeps track of the addresses of the
instruction codes as they are fetch from memory. This is used in a subsequent description
of the program execution.

5
- Other MPU register are used to perform function depending on its type.

Other Types of Registers:


1. Instruction register (IR)- storing instruction codes as they are being decoded
2. Accumulator (Acc)- holding data being operated on by the ALU (accumulator). One particular
register that is heavily used. It stores one operand for any math or logic instructions, and the
result is stored in the accumulator after the instruction is executed.
3. Data pointer (DTPR)- storing addresses of data to be fetched from memory
4. R0 – R7 – other general purpose storage and counting functions

ALU Section
- Performs a variety of arithmetic and logic operations on data. These operations include
addition, subtraction, AND, OR, Ex-OR, shifting, incrementing and decrementing. More
advance MPU have ALU that can do multiplication and division.

Review questions:
1. Explain the difference between a microprocessor and a microcomputer.
2. Name the basic elements of a microcomputer.
3. Name the three major sections of an MPU.
4. What is the function of the PC?

COMPUTER WORDS

Bit- the smallest unit if information in a computer.


Word- a group of bits
Word size- the number of bits that make up a word.
- A common way of describing a computer.
Example: Computers are often describe in terms of their word size such as 8-bit computer,
a 16-bit computer, etc.
- Also indicates the size of the data bus that carries data between the CPU and the memory
and between the CPU and the I/O devices.
4, 8 or 16 bits – typical word size of embedded microcontroller.

64 bits – word size of a current personal computer

Note: a computer with a larger word size can execute programs of instructions at a faster rate because
more data and more instruction information are stuffed onto one word. The larger word sizes, however,
mean more lines making up the data bus, and therefore more interconnections between the CPU and
memory and I/O devices.

Byte – a group of 8 bits


-continues to be used as a unit to describe word size and memory capacity even in computers with
larger word sizes
Example:
8 bits computer= word size of 1 byte
16 bits computer= word size of 2 bytes

6
Types of Computer Words
2 kinds of information:
1. Instructions
2. Data- can be numerical or character information that is to be processed by a program that the
CPU is executing.
- can be in many forms including unsigned binary, BCD, floating-point (something like
engineering notations), or ASCII codes for characters, among others.
Example:
Signed-bit: +86 = 0 1010110 – numerical data
ASCII code (8-bits): “V” = 01010110 – character information
16-bits ASCII code: “VW” = 01010110 01010111
16-signed bits: +22103 = 01010110 01010111

Review Questions:
1. What two types of information are stored in computer words?
2. What is the advantage of a larger-word-size computer?

INSTRUCTION WORDS
- These words contain the information necessary for a computer to execute its various
operations, and the format and codes for these can vary widely from computer to
computer.
- Carry two basic units of information:
1. The operation to be informed (op code)
2. The address of the operand (data) to be operated upon (operation address)

5-bit Op Code 3-bit Add.Reg.

7 6 5 4 3 2 1 0
Figure: Typical Single-Address Instruction Word

Operation code (op code) - represents the operation that the computer is being instructed to perform,
such as addition, subtraction, or moving data. It tells the computer what to do.

Operand address – represents the location in memory where the operand is stored. It tells computer
where to get data.

Example: “to move to the accumulator the data in register 3”


Solution: 11101 011

Op code register address


Result: the eight-bit data word contained in R3 is moved (actually copied) into the accumulator. The
original contents of the accumulator are lots.

MULTIBYTE INSTRUCTIONS
Single word – a complete instruction that contains op code and operand address information stored in a
single memory location.

7
Three basic instruction formats:
1. Single –byte instruction
byte 0ne : Op Code
bits 7 6 5 4 3 2 1 0

2. Two-byte instruction
byte 0ne : Op Code
bits 7 6 5 4 3 2 1 0

byte Two: Operand Address


bits 7 6 5 4 3 2 1 0

3. Three-byte instruction
byte 0ne : Op Code
bits 7 6 5 4 3 2 1 0

byte Two: Operand Address


bits 7 6 5 4 3 2 1 0

byte Three: Operand Address


bits 7 6 5 4 3 2 1 0

Purpose:
Byte one – for the op code (instruction such as add, move, etc.)
Byte two – for the data value
Byte three – operand address

Addressing mode – mode of specifying data.


Six addressing mode:
1. Direct addressing mode
2. Immediate addressing mode
3. Extended addressing mode
4. Indexed addressing mode
5. Indirect addressing mode
6. Relative addressing mode
Note: we will discuss in detail the various addressing mode later.

EXECUTING A MACHINE – LANGUAGE PROGRAM

Machine language – the instruction words that are represented by 1s and 0s, the only language that the
machine (computer) understand.
Example: Some 8051 instructions

8
Mnemonic – abbreviation of instructions for easier to remember than op code.

High-level language – these are languages design to make it easy for man to write a program.

Example: Turbo C, C++, Visual basic etc.

Note: it is important to understand that these high-level language instructions must be converted to
machine language instructions and placed in the computer’s internal memory before the computer can
execute them.

Compiler – a software or program that converts high-level language into machine language. It translates
these high-level instructions into a set of binary instructions (machine language) that can be loaded into
the microcomputer’s memory.

Assembly language – the complete set of mnemonics for a computer instruction set

Example:

Write a machine-language program that starts at address 0000H and does the following:

1. Jumps to the correct address to start the program


2. Decides if the value in the accumulator is a 0.
3. If A is not equal to 0, display the accumulator value by outputting it to port 1.
4. Waits 1 second
5. Decreases the accumulator value by 1.
6. Repeats from step 3 until the value in the accumulator is 0.

9
Memory Memory
Assembly Language Description
Address Contents
(hex) (hex)
0000 2 LIMP 0100H JUMP to start of program
0001 1
0002 0

0100 60 JZ 010AH Should we cook the food?


0101 8

0102 F5 MOV P1, A Display cook time on part 1


0103 90

0104 12 LCALL 1_sec_delay Waste one second


0105 28
0106 55

0107 14 DEC A Subtract one second from time

0108 70 JNZ 0102H Is the food done?


0109 F8

010A **** This is where the rest of the program continue****

First two column – are the machine language program

First column – lists the hex address of each memory location being used by the program

Second column – gives the hex equivalent of the word stored in each memory location

Note: These hex values represent the actual binary addresses and instruction codes that the computer
understands.

Third column – gives the assembly language mnemonic and operand address associated with each
instruction.

Explanation:

The program starts executing at address 0000 when power is first applied, which resets the system. The
instruction that is generally stored at the reset address is a jump instruction that sends the micro to the
main program. The main program in this case starts at 0100, where it makes a decision either to jump
immediately to the rest of the program at 010A or to execute the instructions from 0102-0109. In either
case, it eventually executes the rest of the program from 010A until it is told to jump back to 0100 and
do it all over again.

PROGRAM EXECUTION

2 kinds of operating cycles:

10
1. Fetch cycle – during which the control unit fetches the instruction codes (op code and operand
address) from memory
2. Execute cycle – during which the control unit performs the operation called for by the op code.

Reset – operation starts here when activated by applying power. This will initialize a program counter
(PC) to a starting count of 0000.

Recall: Program counter – a counter within the control unit that keeps track of the program addresses
as the computer sequences through them.

See previous sample of machine – language program.

TYPICAL MICROCOMPUTER STRUCTURE

Write operation – when CPU sending data to another computer element and CPU is writing into the
selected element.

Read operation – when the CPU is receiving data from another element and the CPU is reading from the
selected element.

Bus system – carry all of the information and signals involved in the system operation.

Three buses:

1. Address bus – a unidirectional bus (information flows in only one direction), from CPU to the
memory or I/O elements that carry memory addresses/locations. Each of these addresses
corresponds to one memory location or one I/O element.
2. Data bus – a bidirectional bus (data can flow in either direction), from or to CPU that carry
various data. The CPU is performing a read /write operation.
3. Control bus – a set of signals that is used to synchronize the activities of the separate
microcomputer elements/units. Example is the CPU’s interrupt input, used by I/O devices to get
the attention of the CPU when it is performing other tasks.

TIMING
- Generates the basic clock signal to time all of its operation.

Two types of cycles:

1. Machine cycle – all operations of the system, such as fetching and executing instructions,
reading and writing data, fit exactly into periods.

1 machine cycle = 12 clock cycle = 1 microseconds at 12 MHz

2. Bus cycle – timing that takes place in a bus system

3 distinct type of bus cycle:

Bus Cycle Control signal Data transferred


Fetch cycle PSEN ' CPU←program memory
Data read Cycle RD' CPU← I/O or data memory
Data write cycle WR' CPU → I/O or data memory

11
12

You might also like