Chapter 4
Microcomputer
Fundamentals
BMMA 2343 MICROPROCESSOR TECHNOLOGY
Norain binti Rahim
Universiti Teknikal Malaysia Melaka
[email protected] UTeM | Excellence Through Competency
Chapter Overview
1. Introduction
2. Microcomputer
3. Microprocessor
4. Microprocessor Architecture
5. Microcontroller
6. Bits, Bytes, Word
7. Instruction, Program, Software
8. Assembly Language
UTeM | Excellence Through Competency
3 1. Introduction
• A computer is a general purpose machine commonly
consisting of digital circuitry that accepts input;
stores, manipulates and generates outputs in
accordance to instructions called program.
• Computer categories:
a. Mobile computers
b. Minicomputers (midrange computers)
c. Microcomputers (personal computers)
d. Mainframe computers
e. Supercomputers
UTeM | Excellence Through Competency
4 1. Introduction
Microcomputers Supercomputers
Mobile computers Mainframe computers Minicomputers
UTeM | Excellence Through Competency
5 2. Microcomputer
• A microcomputer is a complete computer on a smaller
scale and generally a synonym for the more common
term, personal computer (PC).
• A microcomputer contains:
o Microprocessor
o Memory (RAM and ROM)
o I/O Devices
o Bus Microcomputers
UTeM | Excellence Through Competency
6 2. Microcomputer
• Components work together / interact with each other
to perform a given task.
• Communications between components via system
bus lines such as data bus, address bus and control
bus.
Memory bus Microprocessor bus I/O Devices
UTeM | Excellence Through Competency
7 3. Microprocessor
• A microprocessor is a single, digital integrated circuit
that performs the function of a central processing
unit (CPU). Example: Intel, AMD processor chips.
• It also known as MPU (microprocessor unit)
• A microprocessor able to:
i. Perform various computing functions.
ii. Make decisions to change the sequence of
programming execution.
iii. Control all operations executed within
microcomputer.
UTeM | Excellence Through Competency
8 3. Microprocessor
• Characteristics of a microprocessor:
✓ Multipurpose.
✓ Programmable.
✓ Clock-driven.
✓ Register-based electronic device.
✓ That reads binary instructions from memory.
✓ Accepts binary data as input.
✓ Processes data according to those instructions.
✓ And provides results as output.
UTeM | Excellence Through Competency
9 4. Microprocessor Architecture
Internally, microprocessor
is made up from three main
Microprocessor units:
1) Control Unit
2) ALU
3) Register Array
Basic Microcomputers Architecture
UTeM | Excellence Through Competency
10 4. Microprocessor Architecture
1) Control Unit
• Provides the necessary control and timing signals to all
operations in the microprocessor as well as its contact to
the outside world.
• Has control lines each of the microprocessor’s logic
function : ALU, register, memory, I/O Device.
• The timing signal such as clock provides
synchronization for communication between the
components of microprocessor.
• It also processes interrupt and power-up sequence.
UTeM | Excellence Through Competency
11 4. Microprocessor Architecture
2) ALU (Arithmetic/Logic Unit)
• Performs all computing and
logic operations such as
addition, subtraction as well as
AND, OR and XOR.
UTeM | Excellence Through Competency
12 4. Microprocessor Architecture
3) Register Array
• A collection of registers within the microprocessor itself.
• Registers are fast memory element.
• These registers are used primarily for data storage during
program execution.
• The number and the size of these register differ from one
microprocessor to the other.
• Some registers are general-purpose and some are special-
purpose.
UTeM | Excellence Through Competency
13 4. Microprocessor Architecture
3) Register Array (Cont…)
• General-purpose registers are free to be used by the
programmer for any purpose.
• The general purpose registers in 8085 processors are B, C, D,
E, H and L.
• Each register can hold 8-bit data.
• Special-purpose register is the one that used to do specific
task such as flag indicator.
• Example: Program Counter (PC), Stack Pointer (SP) etc.
UTeM | Excellence Through Competency
14 4. Microprocessor Architecture
4) Memory – essential component
• Essential components of a microprocessor system.
• Stores instruction and data for the microprocessor.
• Various types of memory can be classified into two groups:
1. Main memory (e.g. RAM, ROM)
2. Storage memory (e.g. magnetic tape, disk)
UTeM | Excellence Through Competency
15 4. Microprocessor Architecture
4) Memory (Cont…)
RAM
• Random Access Memory (RAM) is made of registers.
• Each register has a group of flip-flop or latches that store bits
of information.
ROM
• Read Only Memory (ROM) stores information permanently in
form of diodes.
• A group of diodes can viewed as a register.
UTeM | Excellence Through Competency
16 4. Microprocessor Architecture
5) IO Device – essential component
• System communicating with outside world through IO Device.
• Collectively known as peripherals.
• Input devices transfer binary information from outside world
to microprocessor
• Example: keyboard, bar code reader, scanner
• Output devices transfer binary information from
microprocessor to outside world
• Example: LED, buzzer, LCD Screen
UTeM | Excellence Through Competency
17 5. Microcontroller
• Microcontroller is a microcomputer built on single
chip and also known as MCU (microcontroller unit).
• Consists of:
o microprocessor
o memory
o input/output devices
o additional peripherals
• Example : microchip PIC, MOTOROLA, ATMEL chips.
UTeM | Excellence Through Competency
18
Microcontroller 8051 Microcontroller 8051
Development Board Pin Diagram
UTeM | Excellence Through Competency
Working with IO Devices
19
Microcontroller with basic inputs and outputs connected
UTeM | Excellence Through Competency
Working with IO Devices
20
• When the temperature drops, the thermistors resistance rises rapidly. The microcontroller circuit detects this
rise in resistance switches ON two outputs. This means that the LED illuminates and the solenoid energises.
• When the temperature rises, the microcontroller switches the two outputs OFF, the LED fades and the
solenoid returns to its normal state.
UTeM | Excellence Through Competency
21 Application: RC Car
Antenna Antenna
Front Electric
Forward RF RF Receiver Microcontroller
Microcontroller Motor (Left/Right)
Transmitter
Reverse
Rear Electric Motor
Left Power Power (Fwd/Reverse)
Voltage Regulator Voltage Regulator
Right
Car lights (LEDs)
Batteries
Controls Batteries
UTeM | Excellence Through Competency
22 6. Bits, Bytes, Word
• Computer operates in binary digits (0/1), known as bit.
• Represented in term of electrical voltages.
• A combination of 8 bits equals to 1 byte.
• A group of bits that is executed in one time is called a
word.
• Depends on the microprocessor:
8-bit, 16-bit, 32-bit, 64-bit microprocessor.
UTeM | Excellence Through Competency
23 6. Bits, Bytes, Word
1kB = 210 = 1024 bytes 103
1MB = 220 = 1 048 576 bytes 106
1GB = 230 = 1 073 741 824 bytes 109
1 099 511 627 776 bytes 10
12
1TB = 2 40
=
UTeM | Excellence Through Competency
24 7. Instruction, Program, Software
• Instruction
o Combination of bit pattern that has specific
meaning
• Program
o Set of instructions written from
microprocessor to perform a task
• Software
o A group of program
UTeM | Excellence Through Competency
25 8. Programming Languages
• Microprocessor is driven by software
instructions to perform specific task.
The instructions can be written in:
a. Machine Language Low-level
b. Assembly Language Language
c. High-Level Language
UTeM | Excellence Through Competency
26 8. Programming Languages
(a) Machine Language
• Language understood by the computer with bunch of 0’s
and 1’s. Program written in machine language can be
executed without being translated.
(b) Assembly Language
• Strings of 0’s and 1’s are replaced into instructions which
resembles English language to represent computer operation
element.
(c) High-Level Language
• User-friendly languages which are similar to English with
vocabulary of words and symbols. These are easier to learn
and require less time to write.
UTeM | Excellence Through Competency
27 9. Assembly Language
• Each computer manufactured has its own set of
instructions written in binary based on the design of
the microprocessor.
• It is difficult to write program in sets of binary
language >> machine language.
• These are easier to use English-like words to
represent binary instructions >> assembly language.
• Both language are microprocessor-specific. Assembly
language is considered as low-level language.
UTeM | Excellence Through Competency
28 9. Assembly Language
• Symbolic codes (mnemonics) for each instruction in
machine language.
• Consists of letter that suggest the operation to be
performed by that instruction.
• Example:
0011 1100 (3CH) = INR A
1000 0000 (80H) = ADD B
• Assembly language will be translated into binary
instructions using a program called assembler.
UTeM | Excellence Through Competency
29
UTeM | Excellence Through Competency