Title: Machine Architecture
1Machine Architecture
- Week 4 taken form the online source
- http//courses.cs.vt.edu/csonline/MachineArchitect
ure/Lessons/Introduction/index.html
2Review Data Processing
Processing by Computer
- Data
- eg ESB meter readings
INFORMATION eg bills
Maintained Data eg names, addresses, account
numbers, last meter reading, amount already owed.
3Review Scientific Processing
Processing by Computer Large amount of
calculations of changes over small distances and
time periods.
- Data
- eg current weather conditions
INFORMATION description of tomorrows weather
4What should I be able to do at the end of this
section of the Course?
- Explain the various ways data is represented in
computer memory - Reproduce the truth tables for the AND, OR, and
NOT gates - Trace the logic of circuits composed of a few
simple gates - Describe the behavior of the following circuits
the decoder, the latch, and the adder - Write simple programs in machine code.
5Data Storage
- bit or binary digit
- Base 2 (has 2 digits in the numbering system (1
or 0). We normally use base 10 since there are 10
digits in our base, 0 -9 (0 is a valid number). - two states can represent the values of true or
false - Since bits provide the foundation for all data
storage, it is not surprising that the binary
number system is very important to computers
6Data representation
- Bits - Binary numbers
- Nibble ½ a byte
- Byte 8 bits group together to form a
representation - Word a grouping of 2 or more bytes to form a
machine representation.
7Some ASCII Codes
- Binary Code
- 00100000
- 00100001
- 00110110
- 00110111
- 01000001
- 01000010
- 01100001
- ASCII Character
- SPACE
- !
- 6
- 7
- A
- B
- a
How many possible characters can be represented
with 8 bits?
8bytes
- Modern bytes are made up of eight bits
- The bits in a bite encode data such as numbers
(integers and reals) or character symbols - With only eight bits, the range of values that
can be represented is very limited (256). - computers systems use two or more bytes when
representing real numbers or Chinese Characters
9Real Numbers vs. Integers
- An integer does not have any decimal points, a
real number will have a decimal point. - To represent real numbers the computer uses a
system called floating point notation. Floating
point notation is similar to scientific notation.
We have a mantissa and an exponent and a sign
bit.
10From the online Courseware
11Boolean Operations and Logic Gates
- NOT
- AND
- OR
- Operator Precedence
- Truth Tables
12Gates
- Gates are tiny electronic devices that manipulate
binary data in fixed ways. - Three important gates are the AND gate, the OR
gate, and the NOT gate. - For each of these gates, we can describe their
behavior
13Boolean Algebra
- Based on symbolic logic, designed by George Boole
- Boolean expressions created from
- NOT, AND, OR
14NOT
- Inverts (reverses) a boolean value
- Truth table for Boolean NOT operator
15AND
- Truth table for Boolean AND operator
16OR
- Truth table for Boolean OR operator
17Some comments about gates
- Notice that the AND gate and the OR gate have two
inputs while the NOT gate has a single input.
18Some Comments about gates
- Earlier we described various ways that bits can
be represented 0 or 1, off or on, false or true,
high voltage or low voltage. Since gates are
electronic devices, the appropriate way to
represent binary data is with low or high voltage
level.
19Operator Precedence
- Examples showing the order of operations
20Truth Tables (1 of 3)
- A Boolean function has one or more Boolean
inputs, and returns a single Boolean output. - A truth table shows all the inputs and outputs of
a Boolean function
Example ?X ? Y
21Truth Tables (2 of 3)
22Truth Tables (3 of 3)
- Example (Y ? S) ? (X ? ?S)
23Circuits
- Using the gates, computer engineers can construct
more complex pieces of logic - In the courseware there are examples of circuits.
After this presentation go to the courseware and
do the section on circuits. -
24The Central Processing Unit
- The understanding of circuits leads us to the
heart of a computer is the central processing
unit or CPU. - The CPU contains all the circuitry that the
computer needs to manipulate data and execute
instructions. - The CPU is composed of five basic components
25RAM
- this component is created from combining latches
with a decoder. The latches create circuitry that
can remember while the decoder creates a way for
individual memory locations to be selected.
26Registers
- these components are special memory locations
that can be accessed very fast. Three registers
are shown the Instruction Register (IR), the
Program Counter (PC), and the Accumulator
27Buses
- these components are the information highway for
the CPU. Buses are bundles of tiny wires that
carry data between components. The three most
important buses are the address, the data, and
the control buses.
28ALU
- this component is the number cruncher of the CPU.
The Arithmetic / Logic Unit performs all the
mathematical calculations of the CPU. It is
composed of complex circuitry similar to the
adder presented in the previous lesson. The ALU,
however, can add, subtract, multiply, divide, and
perform a host of other calculations on binary
numbers.
29Control Unit
- this component is responsible for directing the
flow of instructions and data within the CPU. The
Control Unit is actually built of many other
selection circuits such as decoders and
multiplexors. In the diagram above, the Decoder
and the Multiplexor compose the Control Unit.
30The CPU from the Courseware
31The CPU executes a Program
- The program that the CPU executes is a machine
language program. - the CPU functions by following a cycle of
fetching an instruction, decoding it, and
executing it.
32Machine Instructions
- Normally, each machine instruction is composed of
two parts the op-code and the operand
33Machine Language
- Go to the Courseware
- http//courses.cs.vt.edu/csonline/MachineArchitect
ure/Lessons/CPU/index.html