Title: Course DT2111
1Course - DT211/1
- Subject - Computer Technology
SEMESTER 1 REVISION
2Topics Covered
- Systems Overview
- Representing Information
- Binary, Octal, Hexadecimal
- Memory and Buses
- Boolean Algebra
- Logic Gates
- Flip-Flops and Latches
- Assembler
- Software
3Systems Overview
- Computer Systems
- Hardware of a Computer System
- Software of a Computer System
- Configuration
- Internal Hardware
- Internal Software
- Operating Systems
4Representing Information
- Types of Information Information on a Computer
- Binary Numbers
- Representation of Symbols and Text
- Representation of Images
- Image Resolution
- Representing Sound
- Representing Instructions
5Binary, Octal, Hexadecimal
- Numbers and Their Bases
- Bytes
- Binary Mathematics
- Twos Complement
- Representing Negative Numbers
- Octal Representation
- Hexadecimal Representation ('Hex')
6Memory and Buses
- Memory
- Internal Memory
- Registers
- Control and Status Registers
- User-Visible Registers
- Cache, RAM and ROM
- System Bus
- Processor Bus
- Memory Bus
- Address Bus
- Programmed I/O
- Memory-Mapped I/O
7Boolean Algebra
- The Algebra of Logic
- Using Boolean Algebra with Binary
- Boolean Arithmetic
- Algebra Effects
- Duality, Involution, Absorption
- De Morgans Theorem
8Logic Gates
- The Principles of Logic Gates
- Gate Representations AND, OR, NOT
- Logic Gates for Data Movement
- NAND and NOR Gates
- Logic Types
- The CPU Clock
9Flip-Flops and Latches
- What is a Latch?
- What is a Flip-Flop?
- Flip-Flop Types
- What is the Difference Between a Latch and a
Flip-Flop? - What is a Shift Register?
- What is a Counter?
- D Latch
- Edge-Triggered D Flip-Flop
- Binary Counter
10From Electricity to Software
- Everything that a computing device does is based
on electricity. - The computing machine is a switching (or relay)
device it can only switch power on and off by
pushing voltage through series and parallel
circuits, triggering switches by having high
power to cause the current to flow, or no power,
causeing no flow or stoppage of the electricity.
11From Electricity to Software (2)
- The flow of electricity is used to represent the
number 1, no flow is used to represent 0. - Groups of these 0s and 1s can be used as codes
for the numbers, 0, 1, 2, 3 9 as well as
letters, a, b, c z and many other symbols and
graphics, sounds and very importantly logical
and mathematical instructions.
12From Electricity to Software (3)
- Computer Architecture is about creating circuits
very often microscopic circuits that will
control the flow and storage of these numbers and
symbols (data) and instructions (software). - N.B. Binary numbers are well known for
representing data but be sure to remember that
binary strings are also used to represent
individual instructions. A processor might use
100 of these and they are called the instruction
set.
13From Electricity to Software (4)
- Where would you see binary numbers for both data
and instructions mixed together? In machine
code. - Machine code flows through the processor to and
from memory, registers and chipsets via buses
to execute the instructions of the code, using
the data (or operands) attached to the
instructions. But what causes these flows through
the processor and instructions to be executed and
data to be stored?
14From Electricity to Software (5)
- Flip-flops and latches, those are what.
- Electricity flows through the whole motherboard,
passing through many chips containing flip-flops
and latches, craeting millions of 0s and 1s. - Flip-flops and latches are, in turn, made up of
AND, OR, NAND, NOR, XOR and NOT gates. - The groupings of gates will have different
effects. E.g
15From Electricity to Software (6)
- Some gate groupings will cause a mathematical
action such as ADD, others will have logical
effects such as is less than, others will have
storage or diversion-of-flow effects and others
will keep count of clock triggering or data
movement and there are many other types.
16A Software Instruction Example
- Computer System - Consists of Central
Processing Unit, Memory, Input/Output and buses. - Central Processing UnitÂ
- Memory
- Input/Output
- Buses
- Data bus .
- Address bus
- Control bus
17A Software Instruction Example (2)
- Central Processing Unit (CPU) - Controls rest of
computer system through the execution of program
algorithm instructions. - Memory - Stores program algorithm instructions
and data. Consists of multiple storage locations
that can be individually addressed by the CPU to
store or retrieve the value held at that
location. - Input/Output - Connects CPU to devices (printers,
monitors, etc.) in the world outside.
18A Software Instruction Example (3)
- Buses - Essentially wires that connect CPU to
memory and Input/Output devices. - Data bus - Carries data between CPU, memory and
I/O. Note that data is anything stored or
retrieved to or from memory or I/O devices. - Address bus - Carries the address of the memory
location or I/O device the CPU is accessing. In
this simple model, only the CPU can generate an
address. - Control bus - Carries control signals such as
read or write memory, an interrupt has occurred,
clock signals, etc.
19A Software Instruction Example (4)
20A Software Instruction Example (5)
- The CPU's function is to execute program
instructions stored in memory. How does the CPU
execute a high-level language program? - Consider the following C statementÂ
- Y S T - R
-
- The Hypothetical Machine or other computer cannot
execute a program written in symbolic form such
as C directly.
21A Software Instruction Example (6)
- Each C symbolic statement must be translated
to the corresponding machine instructions that
can be executed by that CPU, in this case for the
Hypothetical Machine. - A C compiler can translate the Y S T - R
into the Hypothetical Machine program code that
follows, where four machine instructions are
translated from the single C statement.
22A Software Instruction Example (7)
- This is due to C having four operands
(variables) Y, S, R, and T in one statement but
each Hypothetical Machine instruction can have
only one operand in memory. - How can the Hypothetical Machine do arithmetic
operations with only one operand instructions
when most operations require three operations,
example XYZ. The Hypothetical Machine has an
accumulator named A that, as in a calculator, is
always one of the operands. The following
illustrates how Y S T - R is implemented in
Hypothetical Machine language.
23A Software Instruction Example (8)
24A Software Instruction Example (9)
Y S T - R Translation to Hypothetical
Machine Language
25A Further Instruction Example
- The CPU executes machine instructions that are
stored in memory. How does the CPU of the machine
work? - Suppose we had written the program instructions
to perform Z Y 921. The machine instructions
of the algorithm and data (variables Z and Y, and
constant 921) would be stored in memory.
26A Further Instruction Example (2)
- How would the program, algorithm and data, appear
in the Hypothetical Machine memory? -
- ZY921 in Memory
-
- Note that here the memory contents are
represented by decimal numbers but, in actual
memory, they would look like binary strings
27A Further Instruction Example (3)
- PROGRAM ZY921
- To better see how the program is represented in
memory, we need to know addresses of program
instructions (ALGORITHM) and variables (DATA), as
in the next slide. - The ALGORITHM is stored in memory addresses
000-003, and 007. The DATA (variables) are stored
in memory addresses 004-006.
28A Further Instruction Example (4)
004-006.
29A Further Instruction Example (5)
- Address - Location of individual algorithm
instruction or data. Data variable Y is at
address 005, instruction STA Z is at address 002.
- Instruction - The machine instruction is 5
digits, consisting of two fields, an OPeration
and an ADDRess - OP - The 2 digit code for the operation to be
executed. LDA is OP code of 01. - ADDR - The address of the operand accessed when
OP is executed. Y is operand at ADDRess 005. - Mnemonic - Memory assistance for humans, easier
to remember than a machine code.
30A Further Instruction Example (6)
- The MNEMONIC column entries correspond to the
INSTRUCTION column, so mnemonic Jmp 007 is stored
as machine instruction 30007 (JMP is code 30) at
memory ADDRESS 003. - Variable Y address is 005 so that mnemonic LDA Y
instruction code is 01005 (LDA is code 01 and Y
is at address 005). The constant 921 must also be
stored in memory also, at address 004.
31A Further Instruction Example (7)
32A Further Instruction Example (8)
- As the CPU executes a program, it must maintain
knowledge of the cumulative result or state of
the execution of all previous program
instructions. The CPU architecture consists of
internal memory PC, IR, A, B, MDR, MAR registers
and external memory to hold data to maintain the
state of execution. The register function, memory
size and range are defined as
33A Further Instruction Example (9)
PC 3 digits, holds address in range 000 to 999 of
next instruction. IR 5 digits, holds
instruction (2-digit operation and 3-digit
operand). A, B 5 digits, holds numerical value
in range -99999 to 99999. MAR 3 digits, holds
address in range 000 to 999 of Memory index.
MDR 5 digits, holds numerical value accessed
to/from Memory MAR . Memory 5 digits, array
indexed from 000 to 999, holds values -99999 to
99999
34A Further Instruction Example (10)
- Clock rate is often used by computer
manufacturers as a raw measure of performance.
The Hypothetical Machine operation is timed by a
central clock. We have seen that the
Fetch/Execute cycle consists of a series of
several steps where each step takes one clock
tick so the faster the clock ticks, the faster
the machine executes. The LDA Y instruction of
the Hypothetical Machine requires 7 total steps,
4 steps to fetch and 3 steps to execute. - With a 1 Hz. clock (one tick per second), the LDA
Y instruction would require 7 seconds. With a
1000 Hz. clock (1000 ticks per second), only
7/1000 seconds. With a 400 MHz. clock (400
million ticks per second), only 7/400,000,000
seconds. Note that not all instructions take the
same number of steps to execute and modern CPUs
can perform multiple steps simultaneously.
35A Further Instruction Example (11)
36Assembler
- Typically a modern assembler creates object code
by translating assembly instruction mnemonics
into opcodes, and by resolving symbolic names for
memory locations and other entities. - The use of symbolic references is a key feature
of assemblers, saving tedious calculations and
manual address updates after program
modifications. Most assemblers also include macro
facilities for performing textual substitution -
e.g., to generate common short sequences of
instructions to run inline, instead of in a
subroutine.
37Assembly Language
- A program written in assembly language consists
of a series of instructions - mnemonics that
correspond to a stream of executable
instructions, when translated by an assembler,
that can be loaded into memory and executed. - Example
- MOV AL, 61h
-
- Move the value 61h (or 97 decimal the h-suffix
means hexadecimal) into the processor register
named "AL".
38Software (Pascal, C, C)
- Software is a general term used to describe a
collection of computer programs, procedures and
documentation that perform some tasks on a
computer system. Pascal, C and other high-level
languages are not unlike assembly language in
many ways but more complex to allow the
programmer or user to read and write softwares
coded instructions more easily and quickly than
assembly language or machine code
39Software (2)
- However
- The software instructions of Pascal, C, etc
still need to be converted into machine code
lines of 0s and 1s so that they can be sent
through those logic gates (flip flops and
latches)! - They are converted by other software!
(Translators and compilers).
40Next Semester
- This is the end of Semester 1
- Next semester
- Input Devices
- Storage Devices
- Output Devices
- other interesting topics!