Learning Module 01
Learning Module 01
1
- Differentiate microcontrollers and microprocessors. Define the
different terms and acronyms on a microcomputer systems
terminology, explain the purpose of the circuits in a typical
microprocessor.
- Discuss and explain typical computer architecture, timing signals
and internal microprocessor organization and status flags.
- Discuss and explain the basic blocks of microprocessors;
program execution of conventional microprocessor and typical
32-bit microprocessors
- Understand and explain the concepts of computer systems;
microprocessors data types and the evolutions of
microprocessors
2
III. Table of Contents
Title Page Time
Allotment
Introduction 3 15m
Definition of Terms 10 15m
Unsigned and Signed Binary Numbers 17 10m
ASCII and EBCDIC Codes 18 10m
Unpacked and Packed Binary-Coded- 19 10m
Decimal Numbers
Floating Point Numbers 19 10m
Typical Features of 32-bit and 64-bit 20 10m
Microprocessors
A Simple Microprocessor Application 21 10m
Lecture Activity 23 1.5hrs
Laboratory Activity 23 3hrs
Rubrics 23
Honesty Clause 24
3
IV. Core Content
Introduction
Digital systems are designed to store, process, and communicate information in digital form.
They are found in a wide range of applications, including process control, communication systems,
digital instruments, and consumer products. A digital computer, more commonly called a computer,
is an example of a typical digital system.
• A computer is defined as a machine that can carry out sequences of arithmetic or logical
operations automatically via computer programming. Some examples of a computer is:
DESKTOP
LAPTOP
4
SMART PHONES
SMART WATCH
GAME CONSOLES
5
A computer manipulates information in digital ort more precisely, binary form. A binary number
has only two discrete values: ZERO or ONE. Each discrete value is represented by the OFF and ON
status of an electronic switch called a transistor. All computers understand only binary numbers.
Any decimal number (base 10, with ten digits from 0 to 9) can be represented by a binary number
(base 2, with digits 0 and 1).
6
A subscript is sometimes placed after a number to indicate what numbering system is being used
for example:
The basic blocks of a computer are the central processing unit (CPU), the memory, and the
input/output (I/O).
By definition A central processing unit, also called a central processor, main processor or just
processor, is the electronic circuitry within a computer that executes instructions that make up a
computer program.
7
The CPU of a computer is basically the same as the brain of a human being; so, computer memory is
conceptually similar to human memory. A question asked of a human being is analogous to entering
a program into a computer using an input device such as a keyboard, and a person answering a
question is similar in concept to outputting the program result to a computer output device such as
a printer. The main difference is that human beings can think independently, whereas computers
can only answer questions for which they are programmed.
Computer hardware includes such components as memory, CPU, transistors, nuts, bolts, and so on.
Any physical thing that makes up a computer is considered a hardware.
MOTHERBOARD
8
GRAPHICS CARD
9
Programs can perform a specific task, such as addition, if the computer has an electronic circuit
capable of adding two numbers. Programmers cannot change these electronic circuits but can
perform tasks on them using instructions.
Computer Software consists of a collection of programs - contain instructions and data for
performing a specific task. Basically, a software is a collection of data or computer instructions that
tells the hardware how to work or what to do. Some examples of these software are web browsers,
media player, image viewer, document viewer, operating systems, video games, and many more.
10
There are two main types of software: System software and application software. System
software includes the programs that are dedicated to managing the computer itself, such as
operating systems, file managements utilities, and disk operating systems. Application Software
(App for short) is a program or group of programs designed for the end users. Examples of
application include a word processor, spreadsheet, web browser, an email client, media player, file
viewer, video games.
All programs, written using any programming language (e.g., C++), must be translated into
binary numbers. Therefore, a translator is necessary to convert such a program into only binary
and this is achieved using a translator program called a compiler.
Compiler - a program that converts instructions into a machine-code or lower-level form so that
they can be read and executed by a computer.
Programs in the binary form of 1’s and 0’s are then stored in the computer memory for execution.
Also, as computers can only add, all operations, including subtraction, multiplication, and division,
are performed by addition.
11
Definition of Terms
NOTE: Operand is the part of a computer instruction which specifies what data is to be
manipulated or operated on, while at the same time representing the data itself.
• Arithmetic Logic Unit (ALU) – is a digital circuit used to perform arithmetic and logic
operations. It represents the fundamental building block of the central processing unit
(CPU) of a computer. Modern CPUs contain very powerful and complex ALUs. In addition to
ALUs, modern CPUs contain a control unit (CU).
Read more here : https://study.com/academy/lesson/arithmetic-logic-unit-alu-definition-
design-function.html
12
The function of the ALU is computation, or manipulating numbers in a structured and purposeful
way, like adding two numbers together. The ALU is the mathematical brain of a computer, it is THE
thing that does all of the computation in a computer.
The ALU is a two in one, it has a logic unit and an arithmetic unit. The Arithmetic unit is responsible
for handling all numerical operations in a computer, like addition and subtraction. It also does a lot
of simple things like add 1 to a number, which is called an increment operation. Such logic circuits
that an ALU has is a half adder and a full adder. As the name implies, it’s a circuit that add binary
number together using logic gates.
13
14
As you can see above a full adder is basically two half adders with an extra OR gate. The 1st half
adders sum output is connected to the 2nd half adder’s 1st input. The carry out of both half adders is
connected to an OR gate. And the 2nd input of the 2nd half adder is now a carry input, creating a Full
adder. The circuit you see above can add a single bit, if you want to add more bits you can just
create more full adders and just connect the carry output of a full adder to the carry input of the
next full adder.
Some functions of an ALU are:
- ADD – Sum of A and B
- ADD w/ Carry – Sum of A, B, and Carry-input
- SUBTRACT – Difference of A and B
- SUBTRACT w/ BORROW – Difference of A and B with borrow (carry-input)
- NEGATE – A is subtracted from zero, changing its sign from – to +, or vice versa
- INCREMENT – Add 1 to A
- DECREMENT – Subtract 1 from A
- PASS THROUGH – all bits of A are passed through unmodified
All these functions are done with logic gates that are connected in certain ways, just like the image
above.
15
• Bit - is an abbreviation for the term binary digit. There are only two possible values for a
binary digit, either 1 or 0
• Bit size – refers to the number of bits that can be processed simultaneously by the basic
arithmetic circuits of a microprocessor. A number of bits taken as a group in this manner is
called a word. For example, a 32-bit microprocessor can process a 32-bit word. An 8-bit
word is referred to as a byte, and a 4-bit word is known as a nibble.
A microprocessor normally has an address bus, data bus, and a control bus
An address bus is a computer bus architecture used to transfer data between devices that
are identified by the hardware address of the physical memory (the physical address),
which is stored in the form of binary numbers to enable the data bus to access memory
storage.
A data bus is a system within a computer or device, consisting of a connector or set of wires,
that provides transportation for data. Different kinds of data buses have evolved along with
personal computers and other pieces of hardware.
A control bus is a computer bus that is used by the CPU to communicate with devices that
are contained within the computer. This occurs through physical connections such as cables
or printed circuits.
16
interfaced to the microprocessor. This two-level cache enhances the performance of the
microprocessor.
• Complex Instruction Set Computer (CISC) - contains a large instruction set. It is difficult
to pipeline compared to RISC. Motorola 68020 is a CISC microprocessor.
• Clock – or timing circuits, synchronizes the microprocessor’s components, it’s a circuit that
regulates the timing and speed of all computer functions. The speed of a computer
microprocessor is measured in clock speed, for example, 1 Mhz is one million cycles a
second.
• Memory Management Unit (MMU) - allows programmers to write programs much larger
than could fit in the main memory space available to the microprocessor. The programs are
simply stored in a secondary device such as a hard disk and portions of the programs are
swapped into the main memory as needed for execution by the microprocessor. The MMU is
implemented as on-chip hardware in typical microprocessors such as the Pentium.
17
• Pipelining - is a technique that overlaps instruction fetch (instruction read) with execution.
This allows a microprocessor’s processing operation to be broken down into several steps
(dictated by the number of pipeline levels or stages) so that the individual step outputs can
be handled by the microprocessor in parallel. Pipelining is often used to fetch the
microprocessor’s next instruction while executing the current instruction, which speeds up
the overall operation of the microprocessor considerably
• Read-only memory (ROM) - is a storage medium for the groups of bits called words, and
its contents cannot normally be altered once programmed. A typical ROM is fabricated on a
chip and can store, for example, 2048 eight-bit words, which can be accessed individually by
presenting to it one of 2048 addresses. This ROM is referred to as a 2K by 8-bit ROM. 101
101 11 is an example of an 8-bit word that might be stored in one location in this memory. A
ROM is a nonvolatile storage device, which means that its contents are retained in case
power is turned off. Because of this characteristic, ROMs are used to store programs
(instructions and data) that must always be available to the microprocessor.
18
• Register - can be considered as volatile storage for a number of bits. These bits may be
entered into the register simultaneously (in parallel) or sequentially (serially) from right to
left or from left to right, 1 bit at a time. An 8-bit register storing the bits 1 1 1 10000 is
represented as follows:
A register may hold an instruction, a storage address, or any kind of data (such as a bit
sequence or individual characters). Some instructions specify registers as part of the
instruction. For example, an instruction may specify that the contents of two defined
registers be added together and then placed in a specified register.
A register must be large enough to hold an instruction - for example, in a 64-bit computer, a
register must be 64 bits in length. In some computer designs, there are smaller registers -
for example, half-registers - for shorter instructions. Depending on the processor design and
language rules, registers may be numbered or have arbitrary names.
A processor typically contains multiple index registers, also known as address registers or
registers of modification. The effective address of any entity in a computer includes the
base, index, and relative addresses, all of which are stored in the index register. A shift
register is another type. Bits enter the shift register at one end and emerge from the other
end. Flip flops, also known as bi-stable gates, store and process the data.
• Reduced instruction set computer (RISC) - contains a simple instruction set. The RISC
architecture maximizes speed by reducing clock cycles per instruction and makes it easier
to implement pipelining. A Power PC is a RISC microprocessor.
19
• Superscalar microprocessor is provided with more than one pipeline and can execute
more than one instruction per clock cycle. The Pentium is a superscalar microprocessor.
20
result of an arithmetic operation is too big for the microprocessor’s maximum word size; otherwise
set to 0.
In general, an overflow occurs when the result of an addition to too large to be represented by the
number of bits you are using. This can usually cause errors and unexpected behavior
21
ASCII and EBCDIC Codes
ASCII (American Standard Code for Information interchange) - is a 7-bit character set containing
128 characters. It contains the numbers from 0-9, the upper- and lower-case English letters from A
to Z, and some special characters. The character sets used in modern computers, in HTML, and on
the Internet, are all based on ASCII.
EBCDIC ( Extended Binary Coded Decimal Interchange Code) - is an 8 bit character encoding used
on IBM mainframes and AS/400s. Single byte EBCDIC takes up eight bits, which are divided in two
pieces..
If it is to be very useful, a microprocessor must be capable of handling
nonnumeric information. In other words, a microprocessor must be able to recognize codes that
represent numbers, letters, and special characters. These codes are classified as alphanumeric or
character codes. A complete and adequate set of necessary characters includes the following:
22
- 26 lower case letters
- 26 uppercase letters
- 10 numerical digits (0 – 9)
- Approximately 25 special characters, which include +, /, #, %, and others.
This totals 87 characters. To represent 87 characters with some type of binary code would require
at least 7 bits. With 7 bits there are 2' = 128 possible binary numbers; 87 of these combinations of 0
and 1 bits serve as the code groups representing the 87 different characters. The two most common
alphanumerical codes are the American Standard Code for Information Interchange (ASCII) and the
extended binary-coded-decimal interchange code (EBCDIC). ASCII is typically used with
microprocessors; IBM uses EBCDIC code. Eight bits are used to represent characters, although 7
bits suffice, because the eighth bit is frequently used to test for errors and is referred to as a parity
bit. It can be set to 1 or 0 so that the number of 1 bit in the byte is always odd or even. A
microcomputer program is usually written for code conversion when input/ output devices of
different codes are connected to the microcomputer.
Here is a link for the ASCII table: http://www.asciitable.com/
Here is a link for the EBCDIC: https://www.cs.umd.edu/~meesh/cmsc311/clin-
cmsc311/Lectures/lecture6/ebcdic.html
23
Floating Point Numbers
A number representation assuming a fixed location of the radix point is called fixed-point
representation. The range of numbers that can be represented in fixed-point notation is severely
limited. The following numbers are examples of fixed-point numbers:
In typical scientific computations, the range of numbers is very large. Floating point representation
is used to handle such ranges. A floating-point number is represented as N x rp, where N is the
mantissa or significand, r the base or radix of the number system, and p the exponent or power to
which r is raised. Some examples of numbers in floating point notation and their fixed-point
decimal equivalents are:
In converting from fixed-point to floating-point number representation, the resulting mantissas are
normalized, that is, the digits of the fixed-point numbers are shifted so that the highest-order
nonzero digit appears to the right of the decimal point and a 0 always appears to the left of the
decimal point. This convention is normally adopted in floating-point number representation.
Because all numbers will be assumed to be in normalized form, the binary point is not required to
be represented in microprocessors.
In this section we describe the basic aspects of typical 32- and 64-bit microprocessors. Topics
include on-chip features such as pipelining, memory management, floating point, and cache
memory implemented in typical 32- and 64-bit microprocessors. The first 32-bit microprocessor,
Intel’s problematic iAPX432, was introduced in 1980. Soon afterward, the concept of mainframe on
24
a chip or micromainframe was used to indicate the capabilities of these microprocessors and to
distinguish them from previous 8- and 16-bit microprocessors.
Designers of 32-bit microprocessors have implemented many powerful features of these
mainframe computers to increase the capabilities of microprocessor chip sets: pipelining, on-chip
cache memory, memory management, and floating-point arithmetic. In pipelining, instruction fetch
and execute cycles overlap. This method allows simultaneous preparation for execution of one or
more instructions while another instruction is being executed. Pipelining was used for many years
in mainframe and minicomputer CPUs to speed up the instruction execution time of these
machines. The 32-bit microprocessors implement the pipelining concept and operate
simultaneously on several 32-bit words, which may represent different instructions or part of a
single instruction.
Although pipelining greatly increases the rate of execution of nonbranching code, pipelines
must be emptied and refilled each time a branch or jump instruction appears in the code. This may
slow down the processing rate for code with many branches or jumps. Thus, there is an optimum
pipeline depth, which is strongly related to the instruction set, architecture, and gate density
attainable on the processor chip. With memory management, virtual memory techniques,
traditionally a feature of mainframes, are also implemented as on-chip hardware on typical 32-bit
microprocessors. This allows programmers to write programs much larger than those that could fit
in the main memory space available to microprocessors; the programs are simply stored on a
secondary device such as a hard disk, and portions of the program are swapped into main memory
as needed. Segmentation circuitry has been included in many 32-bit microprocessor chips. With
this technique, blocks of code called segments, which correspond to modules of the program and
have varying sizes set by the programmer or compiler, are swapped. For many applications,
however, an alternative method borrowed from mainframes and superminis called paging is used.
Basically, paging differs from segmentation in that pages are of equal size. Demand paging, in which
the operating system swaps pages automatically as needed, can be used with all 32-bit
microprocessors. Floating-point arithmetic is yet another area in which the new chips mimic
mainframes. With early microprocessors, floating-point arithmetic was implemented in software
largely as a subroutine. When required, execution would jump to a piece of code that would handle
the tasks. This method slows the execution rate considerably, however, so floating-point hardware
such as fast bit-slice (registers and ALU on a chip) processor and, in some cases, special-purpose
chips was developed. Other than the Intel 8087, these chips behaved more or less like peripherals.
When floating-point arithmetic was required, the problems were sent to the floating-point
processor and the CPU was freed to move on to other instructions while it waited for the results.
The floating-point processor is implemented as on-chip hardware in typical 32-bit
microprocessors, as in mainframe and minicomputer CPUs. Caching or memory-management
schemes are utilized with all 32-bit microprocessors to minimize access time for most instructions.
A cache, used for years in minis and mainframes, is a relatively small, high-speed memory installed
between a processor and its main memory. The theory behind a cache is that a significant portion of
25
the CPU time spent running typical programs is tied up in executing loops; thus, chances are good
that if an instruction to be executed is not the next sequential instruction, it will be one of some
relatively small number of instructions clustering around a small region in the main memory, a
concept known as locality of reference. Therefore, a high-speed memory large enough to contain
most loops should greatly increase processing rates. Cache memory is included as on-chip
hardware in typical 32-bit microprocessors such as the Pentium. Typical 32-bit microprocessors
such as Pentium and PowerPC chips are superscalar processors. This means that they can execute
more than one instruction in one clock cycle. Also, some 32-bit microprocessors such as the
PowerPC contain an on-chip real-time clock. This allows these processors to use modern
multitasking operating systems that require timekeeping for task switching and for keeping the
calendar date. Typical 32-bit microprocessors implement a multiple-branch prediction feature. This
allows these microprocessors to anticipate jumps of the instruction flow. Also, some 32-bit
microprocessors determine an optimal sequence of instruction execution by looking at decoded
instructions and determining whether to execute or hold them. Typical 32- bit microprocessors use
a “look-ahead” approach to execute instructions. These 32-bit microprocessors maintain an
instruction pool for a sequence of instructions and perform a useful task rather than executing the
present instruction and going on to the next. The 64-bit microprocessors such as Power PC 750
include all the features of 32-bit microprocessors. In addition, they contain multiple on-chip integer
and floating-point units and a larger address and data buses. The 64-bit microprocessors can
typically execute four
instructions per clock cycle and can run at a clock speed of over 2 GHz. The original Pentium
microprocessor is a CISC microprocessor. Pentium Pro and other succeeding members of the
Pentium family are designed using a combination of mostly microprogramming (CISC) and some
hardwired control (RISC) whereas the PowerPC is designed using hardwired control with almost no
microcode. The PowerPC is a RISC microprocessor and therefore
includes a simple instruction set. This instruction set includes register-to-register, load, and store
instructions. All instructions involving arithmetic operations use registers; load and store
instructions are utilized to access memory. Almost all computations can be obtained from these
simple instructions. Finally, 64-bit microprocessors are ideal candidates for data-crunching
machines and high-performance desktop systems and workstations.
26
27
References:
http://www.asciitable.com/
https://www.cs.umd.edu/~meesh/cmsc311/clin-cmsc311/Lectures/lecture6/ebcdic.html
Microcontroller Theory and Application with the PIC18F by M. Rafsiquzzaman
LAB Activity
Essay
1. Research the history of Microprocessors, note down some of the most relevant
microprocessors in history that made a huge impact on the development of
microprocessors.
2. Look for videos and/ or books about processor manufacturing, and how it is made, and
discuss the processes of production
3. Research simple applications of microprocessors, what are normal everyday things that we
take for granted that are using this technology?
Note: All of the activities here shall be submitted via GMAIL.COM. You may use word, notepad,
or directly write your answers on gmail.com so you may use your phone to construct your
answers.
Rubrics
Criteria 93%-100% 85% - 92% 75% - 84% 65% - 74% Score
Organization Information Information Information The
is very is organized is organized, information
organized with well- but appears to
with well- constructed paragraphs be
constructed paragraphs. are not well- disorganized.
paragraphs constructed.
28
and
subheadings.
Format All sources All sources All sources Some
(information (information (information sources are
and and and not
graphics) graphics) graphics) accurately
are are are documented.
accurately accurately accurately
documented documented, documented,
in the but a few are but many
desired not in the are not in
format. desired the desired
format. format.
Quality of Information Information Information Information
Information clearly clearly clearly has little or
relates to relates to relates to nothing to do
the main the main the main with the
topic. It topic. It topic. No main topic.
includes provides 1-2 details
several supporting and/or
supporting details examples
details and/or are given.
and/or examples.
examples.
Amount of All topics are All topics All topics One or more
Information addressed are are topics were
and all addressed addressed, not
questions and most and most addressed.
answered questions questions
with at least answered answered
2 sentences with at least with 1
about each. 2 sentences sentence
about each. about each.
Grade:
29
Honesty Clause
This honesty clause establishes a fundamental social contract within which the College
community agrees to live. This contract relies on the conviction that the personal and
academic integrity of each individual member strengthens and improves the quality of
life for the entire community. It recognizes the importance of honesty, trust, fairness,
respect, and
responsibility and wishes these principles to be a defining part of Philippine State College
of Aeronautics
I agree that the submission of any academic work shall constitute a representation on my
part both that such work has been done, and its submission is being made, in compliance
with honesty and integrity. Furthermore, my responsibility includes taking action when
I have witnessed or am aware of another’s act of academic dishonesty.
_______________________________
Student’s Name and Signature
30