You are on page 1of 98

C

Subscribe to DeepL Pro to translate larger documents.


Visit www.DeepL.com/pro for more information.

HARACTERISTICS OF
DIGITAL SYSTEMS
The word digital implies that the information in the computer is represented by
variables that take a limited number of discrete values.

Digital computers use the binary number system, which has two digits: 0 and 1. A
binary digit is called a bit. Information is represented in digital computers in
groups of bits.
A sequence of computer instructions is called a program. The data that are
manipulated by the program constitute the database.

▶ Theprograms included in a system software package are referred to as an


operating system.
▶ Computer hardware is generally divided into three major parts.
ACTIVITY (30min)
▶ Watch carefully the video: "How_it_works_a_processor_-
_From_a_transistor_to_a_CPU(youtube.com)" and forming teams of two or more people,
analyze and perform the following activities:
1. What is the content and sequence mentioned at the beginning of the video?
2. Which component do you mean, when you say that all processors and chips are based
on these?
3. In this gate for the electricity to pass, we must press both buttons.
4. All modern processor circuits are based on this technology.
5. How does a processor add up?
6. It is a small circuit in which we can store a 1 or a 0.
7. This element emits a signal from time to time.
8. What will the speed at which a program loads depend on?
9. Give an example of where the MOS6502 processor was used.
10. What was the speed of the MOS6502 processor? And how many bits was it?
CONCEPTS
▶ Computer organization:
It has to do with the way in which the component circuits operate and the way in
which they interconnect to form a computer system.

▶ Computer design:

It deals with the design of the component circuits of a computer system.

▶ Computer architecture :
It has to do with the structure and behavior of a computer system from the
user's point of view. system
from the user's point of view.
A computer:
▶ It is a high performance digital system.
▶ Itis designed with a modular approach.
▶ It can be considered as a general purpose digital processing system.
It will allow us to understand:

▶ How a digital design can benefit from advancing manufacturing technologies.

▶ How we can design digital systems that are more energy efficient.

What explains and determines a computer architecture?


COMPONENTS OF A SYSTEM OF
COMPUTO
LOGIC GATES
The manipulation of binary information is done by logic circuits called gates.
Gates are hardware blocks that produce signals of binary 1 or binary 0 when the
input logic requirements are satisfied.
BOOLEAN ALGEBRA
▶ Deals with binary variables and logical operations.

▶ Variables are designated by letters A, B, X and Y. The three basic logical


operations are AND, OR and complement.

▶A Boolean function can be expressed algebraically with binary variables, the


symbols for logical operations, parentheses and equal signs.

▶ F = X + Y'Z
▶ The relationship between a function and its binary variables can be represented in
a truth table.

▶ A Boolean function can be transformed from an algebraic expression to a


logic diagram, the variables of the function are taken as the inputs of the
circuit and the symbol of the function variable is taken as the output of the
circuit.
EXERCISES
▶ Run the following Boolean functions with gates.

▶ F1 = XYZ'

▶ F2 = X + Y'Z

▶ F3 = X'Y'Z + X'YZ + XY'


Boolean algebra provides a practical tool for:

1. Express in algebraic form the truth table relationship between binary variables.
2. Express in algebraic form the Input/Output relationship of logic diagrams.
3. Find simpler circuits for the same function.
BOOLEAN EXPRESSION
▶A Boolean function specified by a truth table can be expressed algebraically in many
different ways.

▶ Bymanipulating a Boolean expression, a simpler expression can be obtained that


requires fewer gates.
EXERCISES
▶ Reduce the following Boolean expression using the basic Boolean algebra
identities.
DEMORGAN'S THEOREM
Asserts thata NOR gate, representing the function (x + Y)' is equivalent to
the function X'Y'.

Analogously, a NAND function can be expressed by (XY)' or (x' + Y'). For this
reason NOR and NAND gates have two different graphical symbols.
EXERCISES
▶ Simplify the following Boolean function using the techniques seen above.
Also draw the gated representation of the function and its reduction.
COMPLEMENT OF A FUNCTION
▶ From Demorgan's theorem we can derive a simple procedure to obtain the
complement of an algebraic expression.

▶ This is done by changing all OR operations to AND operations and all AND
operations to OR operations and then complementing each individual variable .

▶ The complement of C' is C.


EXERCISES
▶ (ABC)' = A'+B'+C'
= A'+B'+C'.
COMBINATIONAL CIRCUITS
▶ It is an array of logic gates with a set of inputs and outputs. At any given time,
the binary values of the outputs are a binary combination of the inputs.

▶ Combinatorial circuits are used in digital gates to generate binary control


decisions and provide the digital components required for data processing.
▶ The design of combinational circuits starts with the verbal statement of the problem
and ends with a logic circuit diagram. The procedure comprises the following
steps:

1. The problem is established.


2. Literal symbols (letters) are assigned to the input and output variables.
3. The truth table that defines the relationship between inputs and outputs is derived.
4. Simplified Boolean functions are obtained for each output.
5. The logic diagram is drawn.
SEMISUMER
▶ The simplest digital arithmetic circuit is the addition of two binary digits. A
combinational circuit that executes the addition of two bits is called a half
adder.

▶ The input variables of a half adder are called summing and cosuming bits.
The output variables are called summing and cosuming. It is necessary to
specify two output variables because the sum of 1 + 1 is the binary "10",
which has two digits.
▶ We assign the symbols x, y to the two input variables and S(sum) and
C(carry) to the two output variables.

▶ Output C is 0 unless both inputs are 1.

▶ Output S represents the least significant bit of the sum.


FULL OR TOTAL ADDER
▶ It is a combinational circuit that forms the arithmetic sum of 3 input bits. It
consists of 3 inputs and two outputs. Two of the input variables, denoted by X and
Y, represent the two significant bits to be summed.
▶ The third input, Z, represents the carry of the previous least significant
position. The two outputs are designated by the symbols S(sum) and C(carry).
The variable C gives the output carry, the binary variable S gives the value of the
least significant bit of the sum.
▶ The value of the output variables is determined from the arithmetic sum of the input
bits.

▶ When all input bits are 0, C and S = 0.

▶ The output S is equal to 1 when only one input is equal to 1 or when all three
inputs are equal to 1.

▶ Output C has a carry of 1 if two or three inputs are equal to 1.


FLIP-FLOPS
The most common type of sequential circuits is the synchronous type.
Synchronous sequential circuits employ signals that affect the storage
elements only at discrete instants of time.

▶ Synchronization is achieved with a timing device called a clock pulse


generator, which produces a periodic train of clock pulses.

The storage elements used in clocked sequential circuits are called flip-flops. A flip-
flop is a binary cell capable of storing one bit of information.
▶ It has two outputs, one for the normal value and one for the complementary
value of the bit stored in it. A flip-flop holds a binary state until it is directed by
a clock pulse to change state.
FLIP-FLOP SR
▶ It has three inputs, S(start), R(reset or clear) and C for clock. It has an
output Q, and sometimes it also has a complemented output, which is indicated by
a circuit on the other output terminal.

There is a small triangle in front of the letter C, to designate a dynamic


input. The dynamic indicator symbol denotes the fact that the flip-flop
responds to a positive (0 to 1) transition of the clock signal.
FLIP-FLOP D
▶ This is a slight modification of the SR flip-flop. An SR flip-flop is converted
to a D flip-flop by inserting an inverter between S and R, assigning the
symbol D to the single input. The D input is displayed during clock occurrence
from 0 to 1.

▶ If D = 1, the output goes to state 1, but if D = 0, the output goes to state 0.


Although the flip-flop has the advantage of having only one input, it has the
disadvantage that its characteristic table does not have a condition Q(t+1) = Q(t)
"no change".
FLIP-FLOP JK
▶ This is a refinement of the SR flip-flop in the sense that the indeterminate
condition of the SR type is defined in the JK type. The J and K inputs behave
like the S and R inputs to start and restart the flip-flop, respectively.

▶ When the inputs J and K are both equal to 1, a clock transition toggles the flip-flop
outputs to their complementary state.
FLIP-FLOP T
▶ This flip-flop is obtained from JK when the J and K inputs are connected to
provide a single input designated by T. It therefore has only two conditions.

▶ When T=0 (J=K=0) a clock transition does not change the state of the flip-
flop.
T=1 (J=K=1) a clock transition complements the flip-flop state.
FLIP-FLOP SHOT THROUGH THE FLANK
▶ The most common type of flip-flop that serves to synchronize the change of
state during a clock pulse transition is the edge-triggered flip-flop. In this type of
flip-flop, the output transitions occur at a specific level of the clock pulse.

▶ Some flip-flops triggered by the edge have a transition on the falling edge
(positive edge transition) and others cause a transition on the falling edge
(negative edge transition).
EXERCISE
▶ Showthat a JK flip-flop can be converted to a D flip-flop with an inverter
between the J and K inputs.
SEQUENTIAL CIRCUITS
▶A sequential circuit is an interconnection of flip-flops and gates.
▶ The gate by itself constitutes a combinational circuit, but when included
together with the flip-flops, the entire circuit is classified as sequential.

▶ The external outputs of a sequential circuit are functions of both the inputs and the
present state of the flip-flops.

▶ In addition, the next state of the flip-flops is also a function of the present state
and the external inputs.

Thus, a sequential circuit is specified by a timing sequence of the external


inputs, external outputs and binary states of the internal flip-flops.
EXERCISES
▶ Implement the logic circuit having the expression.
▶ Using only NOR and NAND gates.

▶ Determine the output level in Figure 3-24 for A=B=C=1 and D=0.
CHARACTERISTICS OF THE ELEMENTS OF
THE ARCHITECTURE OF THE
COMPUTERS
WHAT IS A DIGITAL COMPUTER?
It is a combination of digital devices and circuits that can perform a programmed
sequence of operations with a minimum of human intervention.

▶ The sequence of operations is called a program.

▶ The program is a set of coded instructions that is stored in the internal memory of
the computer with all the data that the program requires.
HOW DO COMPUTERS THINK?
Computers do not think! The programmer provides a program of instructions
and data that specify all the details of what to do, what to do it for, and when to do
it.

▶ A popular saying in the computer field is: "if you put in garbage, you get
garbage".

How does a computer execute a program of instructions?


SECRET AGENT 89
▶ The secret agent tries to investigate when a certain head of state will be
assassinated. His contact tells him that this information is in a series of post office
mailboxes.

▶ To make sure no one else gets the information, it is disseminated in 10 different boxes.
Your contact gives you 10 keys along with the following instructions:
1. The information obtained in each box is written in code.
2. Open box number 1 first and execute the instruction contained therein.
3. Continue to check the rest of the boxes in sequence unless instructed otherwise.

4. One of the boxes explodes when opened.


1. Add the number stored in box 9 2. Divide the result above by the
to its code number. number stored in the
secret agent. box 10.

4. If the previous result is not


3. Subtract the number stored in equal to 30, proceed t o box 7.
box 8. Otherwise, continue to the next
box.

6. STOP. Now you have the


5. Subtract 13 from the previous
answer.
result.

8.
7. BOMB (very bad)
20

9. 10.
11 2
ORGANIZATION OF A BASIC COMPUTER SYSTEM
Every computer contains five essential elements or units. The arithmetic logic
unit (ALU), the memory unit, the control unit, the input unit and the output unit.

▶ The basic interconnection of these units is shown in the figure below.


LOGICAL ARITHMETIC UNIT
The ALU is the area of the computer in which arithmetic and logical operations
are performed on data. The type of operation to be performed is determined by
the control unit (arrow 1).

▶ The data to be used by the ALU can come from the memory unit(arrow 2) or
from the input unit(arrow 3).

▶ The results of operations can be transferred to the memory unit (arrow 4) or to the
output unit (arrow 5).
MEMORY UNIT
The memory also serves as storage of intermediate and final results of
arithmetic operations (arrow 4). The operation of the memory is controlled
by the control unit(arrow 6).

A given location in memory is accessed by the control unit, which provides


the appropriate address code (arrow 7). Information can be written to the
memory of the ALU or the input unit (arrow 8).

Information can be read from the ALU memory (arrow 2) or from the input unit
(arrow 9).
INPUT UNIT
▶ This unit consists of all the devices that are used to take information and data that
are external to the computer and place them in the memory unit(arrow 8)
or the ALU(arrow 3).

▶ The control unit determines where the input information is sent to (arrow
10).

▶ Some of the common input devices are keypads, switches, etc.


OUTPUT UNIT
▶ Thisunit consists of the devices that are used to transfer data and information
from the computer to the "outside world".

▶ The output devices are driven by the control unit(arrow 12) and can receive
data from the memory la(arrow 9) or from the ALU(arrow 5).

▶ Some output devices are LEDs, indicator lights, printers, etc.


INTERFACES
▶ The components that make up the input and output units are called
peripherals, because they are on the outside of the rest of the computer.

Computer interfacing is specifically defined as the transmission of digital


information between a computer and its peripherals in a compatible and
synchronized manner.
CONTROL UNIT
▶ The function of the control unit should now be obvious. It directs the operation
of all units by providing timing and control signals.

The control unit extracts the instruction from memory by sending an address
(arrow 7) and a read command (arrow 6) to the memory unit.

▶ The main instruction word stored in the memory location is then transferred to the
control unit(arrow 11).
CENTRAL PROCESSING UNIT (CPU)
▶ In Figure 13-2 the ALU and the control unit are shown combined into the
so-called central processing unit or CPU. The above is commonly done to
separate the brains of the computer from other units.

In a microcomputer the CPU is usually a single microcircuit the


microprocessor or at most the microprocessor with one or two additional
circuits.
REVIEW QUESTIONS
1. Name lascinco units units of a computer and describe the
main functions of each.

2. What is the CPU?

3. What does the interface in a computer system refer to?

4. What basic operations occur repeatedly on a computer?


BASIC ELEMENTS OF THE MICROCOMPUTER

It is important to understand the difference between the microcomputer (uC)


and the microprocessor (uP).

A microcomputer contains several elements, where the microprocessor is the most


important of them all.

▶ Generally the microprocessor is a single IC that contains all the circuitry for the
control and arithmetic logic units.

▶ The above is shown in the following figure.


▶ The memory unit displays RAM and ROM devices.

The RAM section consists of one or more LSI circuits connected to provide the
designed memory capacity. This memory section is used to store programs
and data, which will change frequently during the course of operation.

▶ The ROM section consists of one more ROM circuits for storing instructions
and unchanging data.
THE MICROPROCESSOR (MPU)
▶ The MPU is the heart of any computer. It performs many functions, including:

1. Provide control and timing signals for all elements of the microcomputer.
2. Extract instructions and data from memory.
3. Transfer data to and from memory and input/output devices.
4. Decoding instructions.
5. Execute the arithmetic and logical operations invoked by the instructions.
6. Respond to control signals generated at the input/output such as
RESET and INTERRUPTION.
▶ The MPU contains all the logic circuitry necessary to perform the above
functions but, in general, there is no way to access the internal logic.

Instead, we can control what happens inside the MPU by means of a program
consisting of several instructions, which is placed in memory for the MPU to
execute.

When we want to change its operation, we only change the programs stored
in RAM (software) or recorded in ROM (firmware) instead of changing the
electronics (hardware).
▶ The internal logic of the MPU is very complex, but it can be considered as
consisting of three basic sections: the control and timing section , the register
section and the ALU .
▶ The main function of control and timing is to fetch from memory and
decode (interpret) the instructions in memory that are part of a program, and then
generate the control signals needed to execute the instructions.

The register section contains several registers (inside the MPU), each of which has
a special function. The most important of these is the program counter
(PC), which holds the address where the next instruction to be fetched from
memory is located.

The ALU performs a variety of arithmetic and logical operations. During


microcomputer operation, the operations that the ALU performs are carried
out under the control of the control and timing section which, of course,
does what it is instructed to do by the instruction codes in memory.
REVIEW QUESTIONS
1. Explain the difference between a microprocessor and a microcomputer.

2. What are the basic elements of a microcomputer?

3. What are the three most important sections of an MPU?

4. What is the function of the program counter (PC)?


COMPUTER WORDS
The smallest control unit of a computer is the bit. However a single bit carries very
little information.

▶ For this reason, the main unit of information in a computer is a group of bits
which are given the name word .

The number of bits that make up the word is called the word size.
The word size is a way of describing a computer. It is common for computers
to be described in terms of their word size, such as 8-bit computers, 16-bit
computers, and so on.

▶ For example, a 16-bit computer is one in which instructions and data are stored in
memory in 16-bit units and processed by the CPU also in 16-bit units.

In general, a computer with a larger word size can execute instruction


programs at a higher speed, due to the larger amount of data and instructions that
fit within the word. However a larger word size also means a greater number of
connections between the CPU, memory and Input/Output devices.
▶ An 8-bit computer can be said to have a word size of 1 byte. A 16-bit
computer has a word size of 2 bytes, and so on. A memory that stores 128k
16-bit words also has a capacity of 256k bytes.
TYPES OF COMPUTER WORDS
A word stored in computer memory can contain two kinds of information: instructions
or data. The data can be numeric or character information and will be
processed by the program the CPU is executing.

▶ These can be found in many formats, including signed and unsigned binary
representations, BCD, ASCII code for characters, among others.
▶ Here is an example of how the number 86 is stored in an 8-bit word.10
:
01010110
▶ The following example shows how the ASCII code corresponding to the
character "V" is stored in an 8-bit word.
01010110
It is the programmer's responsibility to know what type of data is being stored in
memory and to ensure that the program interprets and processes the data
appropriately.

▶ Words that store instructions are more complex than words that only contain
data.
REVIEW QUESTIONS
What are the types of information stored in the words of a computer?

What are the advantages of a computer that has a larger word size?
WORDS OF INSTRUCTION
▶ The format used with data words varies only slightly between different
computers, especially those with the same word size.

However, the same is not true for the format of instruction words. These words
contain the information necessary for a computer to execute its various
operations, the format and code of these can vary widely from one computer to
another.

▶ But, for most computers, instruction words carry two basic units of information: the
operation to be performed and the address of the operand (data) to be operated
on.
▶ Figure 13-6 shows an example of a hypothetical 20-bit computer
instruction word. The 20 bits of the instruction word are divided into two
parts.

▶ The first part of the word (bits 16 through 19) contains the operation code
(op code, for short). The 4-bit op code represents the operation that the computer
is being asked to perform, such as addition or subtraction. The second part (bits 0
through 15) is the operand address, which represents the location in which the
computer is being
memory where the asked to is
operand perform
stored.the operation.
▶ With 4 bits being used for the op code, there are 24 = 16 different possible codes,
where each indicates a different instruction. This means that a computer
using this instruction word format is limited to 16 different possible instructions
that can be executed.

▶ A more versatile computer would have a greater number of instructions and,


therefore, would require more bits in its op code. In any case, each instruction that
a computer can execute has a specific op code that the computer (control
unit) must interpret (decode).
▶ The instruction word in Figure 13-6 has 16 bits reserved for the address code of
the operand. With 16 bits, there are 216 = 65,536 different possible addresses.
Therefore, this instruction word can specify 16 different instructions and 65,
536 operand addresses. As an example, a 20-bit instruction word might be

The op code 0100 represents one of the 16 possible operations; let's assume it
is the ADD code. The address code is 0101101001110010 or more
appropriately, 5A72 in hexadecimal. In fact this complete instruction word can be
expressed as
▶ This complete instruction word therefore instructs the computer to do the
following:

Extract the data stored in address location 5A72, send it to the ALU, and add
it to the number in the accumulator register. The sum is then stored in the
accumulator (the previous contents of the accumulator are lost).

▶ We will examine this and other instructions in more depth later.


MULTI-BYTE INSTRUCTIONS
▶ We have seen instruction word formats that contain op-code and operand address
information in a single word. In other words, a complete instruction like the one in
Figure 13-6 is stored in a single memory location. For many microcomputers and
minicomputers, the smaller word size makes it impossible to provide the op code
and operand address in a single word.
Since the vast majority of microcomputers use a word length of 8 bits (one
byte), we will describe the instruction formats used in 8-bit computers. With a
word size of one byte there are three basic instruction formats: one-byte, two-byte,
and three-byte instructions. These are illustrated in Figure 13-7.
The one-byte instruction contains only an 8-bit op code, with no address portion. It is
clear that this type of instruction does not specify any memory data to be
operated on. For this reason, single-byte instructions are used to perform
operations that do not require memory data. An example of this would be the
clear register zero accumulator (CLRA) instruction, which instructs the
computer to clear all FFs in the accumulator ALU.

▶ The first two-byte instruction byte in an op code and the second is an 8-bit
address code that specifies the memory location of the operand. In the
three-byte instruction, the second and third bytes form a 16-bit op address. For
these multibyte instructions, the two or three bytes that make up the entire
instruction have to be stored in successive memory locations.
▶ This is illustrated in Table 13-1 for a three-byte instruction. The columns on the
left provide the address locations in memory where each byte (word) is stored.
These addresses are given in hexadecimal code. The second column of the
binary word as actually stored in memory; in the third column is the hex
equivalent of that word. Examine this example in its entirety before continuing and
try to imagine what it represents.
▶ The three bytes stored in locations 0020, 0021 and 0022 constitute in the complete
instruction to add the data word stored in address location 35F6 to the
accumulator. The second and third bytes contain the 8 low-order bytes (LO), the 8
high-order bits (HI), respectively of the operand address.

The op code byte is 3A which is the code for the operation to load the
accumulator into the 8085 microprocessor. Memory location 35F6 is also shown;
its contents are the data word (7C) that the computer control unit will extract and
send to the ALU for addition.
REVIEW QUESTIONS
What is an operation code?

▶ What is an operating address?

▶ What information is contained in the first byte of a multibyte instruction?


EXECUTION OF A PROGRAM IN MACHINE LANGUAGE

The instruction words we have been describing are called machine language
instructions because they are represented by ones and zeros, the only
language the machine (computer) understands. Many other languages can be
used to program a computer and the student may be familiar with some of them,
such as BASIC or Pascal. These low-level languages are designed to make
it easier to write a program.

It is important to understand that these high-level programs have to be


converted to machine language instructions and placed in the computer's
internal memory before the computer can execute them. On a common
microcomputer, the conversion from BASIC to machine language is done
through a special machine language program stored in ROM.
▶ In order to illustrate how a microcomputer executes a machine language
program, we will follow the illustrations described in Table 13.
2. These instructions are part of the instruction set of an 8085 MP but are
representative of the types of instructions that most microprocessors can
execute.

▶ Each instruction is accompanied by a mnemonic or abbreviation that is easier to


remember than the op code. Read the description of each instruction carefully
and keep in mind that the operand mentioned is the data word stored in the
operand address location.
▶ We will use some of the 8085 instructions shown in Table 13-2 to write a
machine language program that starts at address hex 0000 and performs the
following:

1. Loads the accumulator with data from the memory of address 0300.
2. Subtract 1 from these data.
3. If the result of the subtraction is zero, the program stops. Otherwise, the result is
stored again at address 0300 and the program stops.
▶ Table 13-3 shows the complete program as it would be produced in
computer memory. Actually, the first two columns are the program in
machine language; the other information is included for descriptive
purposes. The first column gives the hex address of each memory location used
by the program. The second column gives the hex equivalent of the word stored in
each memory location. Remember that the hex values represent the actual binary
addresses and instruction codes that the computer understands.
The third column gives the mnemonic and operand address (if any)
associated with each instruction. The last column describes the operation
performed by each instruction.

▶ For example the first instruction of the program is a three-byte instruction. The
first byte stored at memory address 0000 is the op code 3A. The second and
third bytes stored at addresses 0001 and 0002 represent the address of
operand 0300. The mnemonic for this instruction is LDA $0300. LDA is the
abbreviation for the accumulator load operation and $0300 is the address of
the operand. The $ sign is often used to indicate that the address is
represented in hex. When the computer executes this instruction it will read the
8-bit data that is stored at location 0300 and load it into the accumulator.
The program starts at address 0000 and ends at 000A. The address location
0300 is used to store data. The contents of the latter locations are not given
because they will generally be variable. The address locations between 000A and
0300 are not used.
PROGRAM EXECUTION

You might also like