Von Neumann Architecture 2019
Von Neumann Architecture 2019
4
Processor fundamentals
Answer :
• Von Neumann introduces the concept of stored program, where program and
data are loaded onto the memory before it is processed.
• Program and data are indistinguishable
• Von Neumann’s architecture uses a single processor.
• The single processor processes instruction in a linear manner, where one
instruction is processed at a time.
• Since one instruction is processed at a time, it takes a long time to process
when large amount of instructions are to be processed. This is called the Von
Neumann’s Bottleneck.
1.4.1 CPU architecture
• Program Counter,
• Memory Data Register,
• Memory Address Register,
• Index Register,
• Current Instruction Register and
• Status Register
Registers
Registers
A register is a discrete memory location within the CPU designed to hold
temporary data and instructions
Then there are special-purpose registers designed to carry out a specific role.
Each of these registers are given a name so that the programmer can write
their software code to access them
A special purpose register is one that has a specific control or data handling
task to carry out.
Registers
Low level languages make direct use of the hardware within the CPU.
This means the programmer needs to know a lot about the internal structure of
the CPU in order to write low level code.
For example, when a program is interrupted its state, ie: the value of
the registers such as the
program counter,
instruction register or
memory address register
In general the more registers a CPU has available, the faster it can
work.
Special Purpose Registers in the Processor
• Program Counter
• Memory Address Register
• Memory Data Register
• Current Instruction Register
• Control Unit
• Accumulator
• Arithmetic Logic Unit
• Index Register
• Status Register
Special Purpose Registers in the Processor
• Program counter
- The address of the next instruction
- Originally set to point to first instruction in the program
- After the contents have been used/passed to memory address register
(MAR)
- PC automatically increments to next address
- If the current instruction is a jump instruction (whose conditions are
met) then the PC is reset to the address in the instruction
- Controls the sequence of instructions
• Control Unit
- Decodes the instruction that has been fetched
- Decides how to carry out the execution of the instruction
- Instructs the relevant registers to carry out the instruction
• Accumulator
- Stores results of calculations/does the arithmetic
- All input to and output from processor pass through the accumulator
- Acts as a temporary storage for data before being processed by ALU
Special Purpose Registers in the Processor
• Index Register
- contains a value which is added to the address (in the CIR) in order to
make the address of the data
- incremented after use so that a set of data can be read one after the
other without altering the raw address
Special Purpose Registers in the Processor
• Status register
Maths in a processor is normally performed using set numbers of bits. For example where you add 8 bits to 8 bits.
00110011 (51)
+00001010 (10)
--------
00111101 (61)
01110011 (115)
+01001010 (74)
--------
10111101 (189)
If we are dealing with twos complement numbers the answer from adding two positive numbers together is negative!
01110011 (115)
+01001010 (74)
--------
10111101 (-67!)
Overflow
Registers in the Processor
Overflow - When the result of a calculation is too large to fit into a set number of bits
1010 (-6)
+1010 (-6)
--------
(1)0100 (+4!)
As you can see in the sum above, we have added two negative numbers together and the result is a positive
number.
To deal with the situations mentioned above we use the status register
Status Register - information about process states such as whether a result is zero, positive/negative
or resulted in overflow.
Registers in the Processor
For the sum that we met earlier we will take a look at how the status register can be used to stop the incorrect answer
arising:
01110011 (115)
+01001010 (74)
--------
10111101 (-67)
Using these flags you can see that the result is negative, if the original sum used only positive values, then we know we
have an error.
1010 (-6)
+1010 (-6)
----
(1)0100
Using these flags you can see that the result is positive when the original used two negative numbers.
1. What is the problem with the result of the following 4 bit sum:
1011 (-5)
+1011 (-5)
---------
• Answer :
2. When a the result of a calculation is too large to fit into a set number of bits.
3. The status register holds flags keeping track of the results of sums, this helps us to see when there is an
error in a result and correct it accordingly.
• Show understanding of the roles carried out by the Arithmetic and Logic
Unit (ALU), Control Unit and system clock
• show understanding of how the bus width and clock speed are factors that
contribute to the performance of the computer system
Arithmetic and Logic Unit (ALU)
• It tells the computer's memory, arithmetic/logic unit and input and output
devices on how to respond to a program's instructions.
• It directs the operation of the other units by providing timing and control signals.
• It directs the flow of data between the CPU and the other devices.
John von Neumann included the control unit as part of the von Neumann
architecture.
• The more pulses sent out by the system clock, the faster the computer.
Depends on:
• Clock speed
• Word size
• Bus size
- Data bus
- Address bus
• Control bus
• Architecture
1.4.1 CPU architecture
• The bus size denotes how many bits can be transmitted at once.
– A data bus: this contains the contents that have been read from the
memory location or are to be written onto the memory location.
• Universal Serial Bus (USB) ports are much faster than serial or parallel
ports and allow multiple devices to be connected to the same port.
Ports
• In computer terms, a port generally refers to the part of connection available
for connection between one computer to peripherals like input and output
ones.
• Computer ports have many uses, to connect a monitor, webcam, speakers, or
other peripheral devices.
Types of ports
Ports
Characteristics of Ports
• Co-processor
• Pipeline Processing
www.wikipedia.org/wiki/Coprocessor
Co-processor
This is a 286 to 386sx upgrade board with Maths Co processor!
• As of 2002, dedicated Graphics Processing Units (GPUs) in the form of graphics cards are
commonplace.
• Certain models of sound cards have been fitted with dedicated processors providing
digital multichannel mixing and real-time DSP effects as early as 1990 to 1994 (the Gravis
Ultrasound and Sound Blaster AWE32 being typical examples), while the Sound Blaster
Audigy and the Sound Blaster X-Fi are more recent examples.
• In 2006, AGEIA announced an add-in card for computers that it calls PhysX. PhysX is
designed to perform complex physics computations so that the CPU and GPU do not have
to perform these time consuming calculations.
• It is designed to work with video games, although other mathematical uses could
theoretically be developed for it.
Parallel processing
What is Parallel Processing?
• Now consider a CPU that has two separate hardware units, one for fetching
instructions and another for executing them.
• The instruction fetch by the fetch unit is stored in an intermediate storage buffer.
• The results of execution are stored in the destination location specified by the
instruction.
• For simplicity it is assumed that fetch and execute steps of any instruction can be
completed in one clock cycle.
Pipeline processing : Pipelining concept in computer architecture
Decode: Instruction 1
Execute: Instruction 1
Linear processing : 1 instruction being processed in 3 seconds
Parallel processing
Fetch : Instruction 1
• The use of many processors, each processor can carry out the same
process on different data.
Data
• Transistor: A tiny electrically operated switch that can alternate between "on"
and "off".
• Chip (aka Microchip aka Integrated Circuit): A tiny piece of silicon that
contains millions of transistors and other electronic components.
Hardware Overview
• Modern-day computer systems usually contain, at a minimum, the following
hardware components:
• The motherboard holds the CPU, RAM and ROM chips, etc.
The System Unit
• The Central Processing Unit (CPU) is the "brain" of the computer. It executes
instructions (from software) and tells other components what to do.
• The Intel Pentium is a popular processor for IBM-PCs.
• The PowerPC is a popular processor for Macintoshes.
• There are 2 parts of the CPU: The ALU and Control Unit.
• The Arithmetic Logic Unit (ALU) performs arithmetic operations (such as
addition and subtraction) and logical operations (such as comparing two
values).
• An optional math co-processor can take the place of the ALU. It performs
the same operations, only it is faster.
• The Control Unit deciphers and carries out instructions.
• Different CPUs have different types of instructions, so software made for one
type of CPU will not run on other kinds.
• The word size denotes how many bits of data a CPU can process at once. 32
bits is the standard word size for CPU's used in personal computers today. The
higher the word size, the faster a CPU can execute instructions.
The System Unit
• The System Clock is an "electrical pulse generator" that sends out a pulse of
electricity at regular intervals. The electronic components of the computer need
these electric pulses in order to perform work. The more pulses sent out by the
system clock, the faster the computer. The first personal computers had clock
speeds of 8 MHz (8 million pulses per second); today's PC's have clock speeds
greater than 3.2 GHz (3.2 billion pulses per second).
• Bus Lines are "electrical data roadways" (i.e. wires) through which bits of
information are transmitted between the CPU and other components. The bus
size denotes how many bits can be transmitted at once. In general, this should
be the same as the CPU word size.
The System Unit
• Memory Chips
• Random Access Memory (RAM), also known as Main Memory or Primary
Storage, is used to hold instructions and data while they are being used. RAM
is volatile, meaning its contents are lost when the power goes off. RAM is
more than 1000x faster than the fastest secondary storage.
• Cache memory is special high-speed memory that temporarily stores
instructions and data the CPU is likely to use frequently. This speeds up
processing. Level 2 or external caches generally range in size from 64
Kilobytes to 2 Megabytes.
• Read Only Memory (ROM) chips are non-volatile memory that generally
contains instructions for "booting" the computer (i.e. loading the operating
system when the computer starts up).
• CMOS chips are powered by a battery and contain so-called "flexible
information" such as the type of hard drive your computer is using and the
current date and time.
• Flash chips do not require electricity or a battery yet are non-volatile. They are
used in computers, cell phones, digital cameras, etc.
The System Unit
• Expansion Slots are sockets on the motherboard that you can plug expansion
cards into. To plug a card into a slot, you must open the system unit. A card
contain a socket on its end that sticks out from the system unit so a cable can be
plugged into it. Common types of cards are graphics, sound, and network cards.
• Ports are sockets that are on the outside othe system unit, meaning you can
easily plug a cable into a port without opening the system unit.
• Serial ports transmit one bit of data at a time.
• Parallel ports transmit 8 bits of data at a time.
• Universal Serial Bus (USB) ports are much faster than serial or parallel
ports and allow multiple devices to be connected to the same port.
Secondary Storage
• Devices that "permanently" hold data and information (i.e. programs).
• Non-volatile memory; when the power goes off, contents are still saved (unless
there is an error).
• Used to store instructions and data while they are not being used
Secondary Storage
• A floppy disk is a removable (i.e. portable) platter made of mylar plastic that is
magnetized. Bits of information are stored in concentric rings called tracks on
either side of the platter. The current floppy disk standard is a 3 1/2" platter in a
hard plastic case that holds 1.44 Megabytes of information. A Zip disk, on the
other hand, can hold up to 250 Megabytes.
• A hard disk is similar to a floppy disk but uses metal platters to store information.
Hard disks are not only much faster than floppy disks but can hold huge amounts
of data (hundreds of gigabytes).
• Both floppy and hard drives use a read/write head, which is basically a magnet,
to read/write information from/to tracks on a platter. In a hard drive, the read/write
head and platter(s) are enclosed together in an air-tight package, making hard
drives less susceptible to damage. The read/write head hovers above the platter
but should not touch it. If touched, the platter can be damaged, resulting in the
loss of some or all the data on the platter. This is known as a head crash.
• Magnetic tape is used mostly for backups. These are very slow because you have
to fast forward or rewind to the right spot. However, they are very reliable.
Secondary Storage
• Optical discs use optical technology (i.e. lasers) instead of magnetic technology
to store information.
• CD-ROM stands for Compact Disc - Read Only Memory.
• CD-R stands for Compact Disc - Recordable and can be written to only once.
(Also known as CD-WORM: Compact Disc - Write Once, Read Many.)
• CD-RW stands for Compact Disc - Re-writeable (or Read/Write).
• DVD-ROM stands for Digital Versatile Disc - Read Only Memory.
• DVD-R stands for Digital Versatile Disc - Recordable and can be written to
only once.
(Also known as DVD-WORM: Digital Versatile Disc - Write Once, Read
Many.)
• DVD-RW stands for Digital Versatile Disc - Re-writeable (or Read/Write).
• CD's can hold approximately 650 Megabytes of data while DVD's can hold
up to 17 Gigabytes.
Input / Output Devices
• Input devices translate data into a form the computer can understand.
• The keyboard is the most common input device, but this type of data entry
is very slow and error-prone.
• Direct input devices are much faster and less error-prone.
• Pointing devices such as the mouse, trackball, and touchpad allow you
to manipulate a cursor on the screen.
• Scanning devices read data directly. For example, OMR (Optical Mark
Recognition) devices (such as a scantron machine) can sense marks on
paper. Even more advanced are OCR (Optical Characgter Recognition)
devices, which attempt to read letters.Bar Code Readers are often used
in grocery stores (i.e. with the UPC - Universal Product Code system) to
scan items.
Input / Output Devices
• Output devices translate information into a form humans can understand.
• The Monitor (or Display Screen) is the most common type of output
device. It producessoftcopy (i.e. temporary) output on a screen.
• The Printer is the most second most common type of output device. It
produces hardcopy(i.e. "permanent") output on paper.
• A Laser Printer uses a photoelectric drum and powdered ink, similar to
a copying machine, to produce output.
• An Inkjet Printer produces output by spraying droplets of liquid ink
onto the paper from small nozzles. It is the most common type of printer
in use today and is generally very inexpensive.
Communications Devices
• These allow your computer to send/receive data to/from other computers.
• A modem sends information over a phone line. Modems are slow and
susceptible to problems such as phone line static.
• A network card sends information over a network cable. These can be used to
hook up a computer to a local area network (LAN) or to an Internet Service
Provider via a cable modem or DSL (for Internet access)
Measurements in Computer Science
• Bit (Binary Digit): Can only have a value of either 0 or 1.
• Byte: 8 bits (also known as a Character).
• ASCII: A code that assigns characters, such as 'a', 'b', etc. unique 8-bit (i.e. 1
byte) values. This allows information created on one computer to be
understood by other computers. Contains English letters only.
• Unicode: A code that assigns characters, such as 'a', 'b', etc. unique 16-bit (i.e.
2 byte) values. This code contains letters for all major languages but still
understands ASCII.
• There are other codes besides ASCII and Unicode, but they are the most
common and are used in virtually all personal computers and most larger
computers as well.
• Kilobyte: 1024 bytes (or 2^10 bytes).
• Megabyte: 1024 * 1024 bytes (or 2^20 bytes). Roughly one million bytes.
• Gigabyte: 1024 * 1024 * 1024 bytes (or 2^30 bytes). Roughly one billion bytes.
• Terabyte: 1024 * 1024 * 1024 * 1024 bytes (or 2^40 bytes). Roughly one trillion
bytes.
Thank you