- Get link
- Other Apps
Introduction to Computer Systems
A system is contained within a boundary, either physical or
logical. Outside the boundary is the environment, which the system interacts
with via inputs and outputs. The system has no direct control over the environment,
it can only control what happens inside the boundary. The system receives
inputs, but has no control over what these inputs are. It gives outputs but has
no control over what then happens to them.
Systems can be defined in many ways. They could have the same
boundary, but a different way of looking at it. It could also have a different
boundary. For example, you could look at a computer system in the following
ways:
- A tool that takes
commands and returns data
- A collection of
components that take in electrical signals and returns electrical signals
- A device for
converting characters to binary code
- A component in an
office workflow diagram
A system is analogous to mathematical relations. A system maps
inputs to outputs. This is an abstraction level which is sufficient for many
purposes.
Systems are nested, therefore decomposition is normally a good
way to study a system. Systems can "overlap" (at least logically).
Definitions can be applied to all systems.
To design a system:
1.
Determine boundary
o
What can be changed
o
What is in the scope of design, what is outside
2.
Determine the interfaces/how it interacts with the
environment
3.
Determine mapping relations
4.
Determine what internal data is required to support mappings
o
Data storage
To design a system to work into an existing system, you need to think of
separate components. Each component contains a boundary and an interface, and
I/O mappings. How the system works should be transparent to each other module.
All you need to know is:
- How to use the
interfaces (I/O structures)
- What the mappings
achieve
- How trustworthy the
components are
Hierarchies
Systems
are hierarchical structures. Each level is a component of a higher level, and
each component also has components at lower levels. Some components and levels are
logical. Each topic in Computer Science tries to deal with one level at a time.
Mixing levels of hierarchy can lead to confusion.
Science and Engineering
Science
explores the physics of computing, i.e., what happens in energy terms, what the
components are and why they behave as they do and the theory underpinning
hardware and software.
Engineering
studies ways to build systems. It looks at the hardware and software, and the
network and systems architectures.
Generalisation of Engineering
Engineering principles in one area usually apply in some form in
other areas (one principle can be applied to, say, civil engineering, just as
much as CS). For example, good practice in development, documentation and
testing principles, the planning and management, dealing with cost
effectiveness and professional oversight are all traits of engineers.
Students rarely meet reality, however engineering is based in
reality. Reality is big, messy and imprecise. Reality changes goals and
resources during projects, demands evidence of performance and wants things to
last forever (but then discards them the following week).
As reality is often too much for engineers to conceive, they
simplify it using models. Models are representations of reality. Programs,
diagrams, mathematical definitions, CAD, working scale models are all examples
of models. Models are used to abstract away detail that is not relevant to the
current purpose. Models can be static (diagrams, maths, etc) or dynamic
(programs, train layouts, animated CAD drawings, etc).
Lifecycles
All engineering projects can be characterised in general terms:
- Requirements
- Specifications
- Designs
- Implementations
- Testing
- Maintenance
- Decommission
We
will briefly look at each. You should apply these principles in other modules.
There are lots of lifecycle models (waterfall, spiral, etc) that can be used.
Lifecycles are abstract summaries of a chaotic reality - don't expect models to
be perfect, but they shouldn't be dismissed either.
Development
methods are different to lifecycles. The methods are practical help with the
development based on expertise/experience of experts.
Requirements
This
is what the system is required to do. This is a constraint also - you should
not be making the system do things that is beyond the requirements.
Requirements are quite general, as this is looking at the system from a high
level. At lower levels, requirements are more specific to a particular
architecture, platform, etc...
Testing
happens against the requirements, therefore the requirements need to be
objective and clear. Requirements also change, and these changes must be
documented. Engineers aim to just meet the requirements; extras are not needed,
or in some cases desired.
Specification
A
specification is a contact for a development. It meets the requirements and is
an abstract description of the requirements - it is not how the requirements
are going to be achieved. It could use diagrams, mathematics or logical analysis.
It needs to be rigorous and unambiguous. It should be checked against the
requirements.
VVC (Verification, Validation and Certification)
Verification
- This checks that the data is factually correct.
Validation - This checks that the data fits in with it's intended use.
Certification - The checks a system against external documentation and operational standards.
Validation - This checks that the data fits in with it's intended use.
Certification - The checks a system against external documentation and operational standards.
Design
This
is less abstract than a specification, however still does not contain any code.
There may be different design at different levels. A design also adds more
constraints.
Implementation
This
must match the design. It also includes documentation - both of the development
and for the users. Implementation is a trivial stage compared to the
specification and designs, if they are done right.
Some
tips for implementation are:
- Re-use code where
ever possible
- Document the original
or re-used code
- Document all change
and the rationale behind those changes to re-used code.
- Write re-usable code
- Use a good style of
coding and document your coding fully
- Document how
procedures and packages are used
- Document what each
component does and the conditions they take.
Testing
This
is the most important part. It is dependent on the earlier parts and consists
of various parts:
- Unit tests - this
tests the internal code
- Module, integration
and system tests - testing the individual components and composition
verification
- Acceptance or
certification testing - validation that works as intended in context and
within standards
Testing
reveals errors, not correctness; it is impossible to show a program is perfect.
Tests should be designed to break the system; you should always be testing for
unexpected things (e.g., illegal inputs, out-of-range data). Testing should
occur close to or on the boundary of the operational envelope.
The
specification and design should be used to identify meaningful tests.
Maintain
Most
systems change after delivery, perhaps a new platform is introduced, etc... Bug
fixes may also need to be applied. Documentation and code needs to be maintained..
Regression
testing should be performed.
- Work out what tests
should and should not still work
- Run all your tests
again and check the results
- Don't just test the
changed parts.
Decommission
Few
systems are ever thrown away. If a system is used, it is likely to be replaced.
You should try to reuse and recycle. There could be lessons to be learnt from
an old system, requirements and scenarios could be similar to the new system,
components might need to be retained and each of these elements requires
careful analysis.
Documentation
is crucial
Computer Hierarchy
A
computer is a hierarchy of parts (a system). There are many overlapping
hierarchies and views, logical and physical views are both hierarchical and you
can look at things from both a functional and architectural point of view. ICS
only covers some of the views and hierarchies that exist.
Events
Any
input is an event. A command or data sent may change the system state. How an
event is determined depends on your view, for example from the view of the CPU
only electrical pulses are valid. Logically this could be a single character, a
signal, etc... From a human view, this could be a string of text, or a whole
mouse movement (which relates to multiple signals).
Keyboard Events
A
keypress sends electrical signals to a keyboard transducer. The transducer
converts the character pressed to an IRA (ASCII) bit value.
Mouse Event
Press,
release, etc are all considered individual mouse events. The window manager
interprets events and movements to commands. Commands are interpreted to
machine instructions in the form of bits.
Bits
are transmitted to the I/O module and memory. Transmission of input is
identical for all bits. In a window, a window manager interprets key presses
and mouse movements to machine instructions or data.
A
filename is a logical reference to a distributed set of addresses. Physically
this is an index address and lots of separate data blocks.
A
computer takes well formed commands and then uses context to deduce what's
intended.
Views and Levels
There are different ways you can look at things:
- Internals - above the
hardware level but below the operating system
- Architecture - how
the programmer sees the system
- Organisation - how
features are laid out
Architecture
- Data representation
- Instruction set
- Addressing
- I/O mechanisms
Most of these are logical abstractions.
Physical signals represent bits and they represent instructions and addresses
Organisation
· Internal signals, clocks and controllers
· Memory addressing
· Instructions
· Hardware support
Structures
and Functions
Structure
|
Functions
|
CPU
|
storage
|
Memory
|
processing
|
I/O
|
movement
|
communications
|
·
control unit - controls
execution cycle
·
ALU - computational core
·
registers - internal
memory
·
connections - connections
between other units
IAS
John von Neumann was at the Princeton Institute for Advanced
Studies (IAS). He came up with the theory for a stored-program computer in about
1945. The first IAS machine was completed in 1952. Although this is later than
Turing's efforts in the 1940's, the IAS system was public and open from
inception so became more well known.
The IAS architecture stored data and instructions in a single read/write
memory. The memory contents were addressable by locations and sequential
execution from one instruction to the next occurred.
Main Memory
Main memory is a collection of locations, each holding a binary
value. Instructions are stored and read sequentially in one set of addresses. A
logical abstraction of this is a stack. All locations have sequential
identities (addresses) which data is stored and accessed by.
Architecture functions and organisation are built round groups
of addresses.
instruction
|
0
|
instruction
|
1
|
instruction
|
2
|
instruction
|
.
|
instruction
|
.
|
instruction
|
x
|
data
|
x+1
|
data
|
x+2
|
data
|
.
|
data
|
.
|
data
|
n-1
|
data
|
n
|
Main memory has n locations. Instructions are in locations 0-x.
The instruction stack is a logical data structure with input at the top, and
reads happen at the top too.
Words and Bits
Each memory location is 1 word. The IAS machine had 1000 words
in memory. The Intel 8088 (1979) had 1 MB. The current Pentium 4 (IA32)
architecture has 64 GB of words.
Each word contains a fixed number of bits. The IAS had 40-bits
words, but most modern systems have 2n bits, for example, Intel
processors until the 386 had 16 bit words. Early Pentium's had 32 bit words and
the Pentium II onwards had 64 bit words.
There are many formats for a word. The simplest is the opcode
followed by an operand. The opcode identifies one machine instruction
(operation). The operand is the address of data to be operated on.
Fetch-Execute Cycle
Computer operations are in a series of cycles. For example,
retrieve a word from main memory, execute instruction in a word, etc..
Instructions locations number logically from 0. When the
computer systems, a program counter (pc) is set (i.e., to 0). This causes the
0th instruction to be fetched. Instruction is then executed and the pc is
incremented. The first instruction is executed next. The fetched instruction is
written to the instruction register (ir) for execution.
The pc and ir are CPU registers, like main memory, but fast and
inside the CPU. pc and ir are CPU registers. The pc only needs to hold an
address. CPU buffers are common, for example, between the pc, ir and main
memory. Buffers could include the mar (memory address register) and the mbr
(memory buffer register)
The CPU control unit determines when to fetch an instruction.
The communication between the main memory and the CPU uses buses for addresses,
control signals and data. The control uses a clock tick (this is a regular
pulse signal). The control units ticks to start the next element of the F-E
cycle.
Fetched instructions might need more memory interaction because
an execution can take place - this is an indirect cycle.
The execution that occurs depends on the instruction in the ir.
For example, it could be
· moving
data among registers, from CPU to main memory, etc
· modifying
control
· I/O
· ALU
invocation
Interruptions
Assume end-to-end execution of stored programs. The CPU is very
efficient compared to other peripherals and the F-E cycle is faster than other
devices. Rather than the CPU hanging and waiting for a device, interruptions
allow the CPU to continue with another instruction and return to one that's
waiting on a device when the interrupt is called.
Different types of interrupts exist:
·
Program
Interrupts - Illegal processing attempted (for example, a divide by 0,
arithmetic overflow or an illegal memory call)
·
Timer
Interrupts - Allow regular functions to occur (housekeeping, polling for data,
etc)
·
Device
Interrupts - Come from device controllers, such as I/O. These signals could be
such as "ready", "error", etc.
·
Hardware
Failure Interrupts - Power out, memory parity error, etc.
Device Handling
A processor fetches an instructiowww.n which involves a device
call. The execution calls a set-up program (I/O program) which prepares buffers
for data, etc... The device driver (an I/O command) is then called and the
execution terminates.
Preparing for an Interrupt Cycle
This is a variant of the fetch cycle. The current pc is stored
in a dedicated address. After the interrupt is completed, the control unit
reads the stored pc value and resumes at that location.
The CPU knows addresses to be used. The interrupt only starts
when the previous instruction is fully executed.
Interrupt Handling
Any device may send an interrupt (signalling that it is ready
for I/O, etc), however the handling details are specific - it might include the
OS for example.
Computer Connections
Devices inside a computer are connected using buses, lines and
interfaces.
There are many different types of connections - point-to-point
(a dedicated link) or a bus (a link shared by many components). A bus
corresponds to a particular traffic type - data, addresses, etc...
Networking can be wired or wireless. Conceptually it is
different to internal communications, but physically it is becoming similar to
buses. Bus and network protocols are slowly converging.
Internal and external communications have different emphases.
Networking has an emphasis on security, whereas buses tend to emphasise
robustness.
Buses link at least two components, and traffic is available to
all logical components connected to that bus. Logically, a bus is dedicated to
either data, addresses or control signals. Physically, a bus comprises of a
bundle of separate bus lines.
Buses are things passing values - like a flow of communications.
In reality, it carries current, so has values at all points simultaneously -
logically this is either 1 or 0. Unfortunately transfer isn't really instant
(assuming that it is is a level of abstraction). A pulse that is either on or
off doesn't exist in the real world. There is a leading edge and a trailing
edge as voltage rises or falls. These edges don't carry any data and signals
are not relevant here.
Buses use serial communications, i.e., 1 bit at a time. There
are 8 lines for an 8 bit bus.
Parallel buses are buses of serial lines. Each bus still carries
one thing, but a communication may be split over many buses. In theory,
parallel is faster and more efficient, however serial buses tend to have higher
data rates due to the overhead of parallel (assembly and disassembly of
packets).
Early buses had separated, unsynchronised clocks - CPU time was
wasted waiting for devices to catch up. Modern buses are controlled by a single
CPU clock, however, variable speeds are being re-introduced according to
application.
Data Bus and Lines
Data buses have one bus line per bit in a word (or multiples of
this), e.g., 32-bit words have 32 (or a multiple of this) data lines, each
requiring its own connection pin.
Address Bus and Lines
Buses may have a memory-I/O split. Most significant bit may say
whether it's intended for memory or an I/O address.
Control Bus and Lines
These are normally sufficient with 1 bit. They carry things such
as timing signals (clock/reset), command signals and interrupt signals.
Modules and Interfaces
Each computer component is a module with an interface. It is
based on the engineering principle of each module being self-contained with
minimal interfaces. This is true of modules in any other engineering (software,
etc)
Memory Interface
The memory interface passes fixed length words to the memory.
The memory doesn't care what it's storing, it could be an address or data, or
anything.
Control signals (read signal, write signal) tell the memory
module what to do, the address bus carries the address that's being considered,
and the data bus will either carry the contents of the memory to or from the
memory.
CPU module
The CPU is "intelligent". It identifies the content of
the data bus to be different types and deals with them accordingly.
Coming in, it has control signals (interrupts) and data signals
(instructions and data). Going out it gives out control signals, addresses and
data.
IF YOU HAVE ANY DOUBT RELATED TO THIS TOPIC PLEASE LET US KNOW
COMMENT DOWN BELOW
- Get link
- Other Apps
Comments
Post a Comment