Microsoft PowerPoint – SN-2017-Sec01.pptx
Systems and Networks
Dr Lewis Mackenzie
School of Computing Science
University of Glasgow
Lewis.Mackenzie@glasgow.ac.uk
Systems and Networks Preliminaries 2
Basic Info
• Motivation. How computers and networks work: a broad overview, all the way from
hardware architecture up to systems software
• Benefits. Understanding the basic concepts of systems will help you to use computers
more effectively
• No compulsory texts.
– All examinable materials available on Moodle
• Slides will be available in advance through Moodle. Check it regularly!
• Slides do not cover everything in lectures.
– Anything discussed in a lecture is examinable whether it is on a slide or not.
– Lecture attendance is strongly recommended in this course
• Assessed Coursework (20%)
• Examination in May (80%)
1. Introduction
Systems and Networks Introduction 4
The Aim of Computer Systems
Complexity
Computer hardware
~ 1010 transistors.
E.g. Intel “Broadwell-E” Core i7-6950X
microprocessor (2016) has 3.2 billion
transistors on a 246 mm2 die.
System software
~107 lines of code in a modern OS
Core i7-6950X die detail
Build computer systems (capable of running applications and services,
communicating with users and other computers) from very many simple
components – e.g. transistors & wires.
Systems and Networks Introduction 5
Levels of Abstraction
Digital Circuits
Instruction Set
Operating System
Application Software
Supports processes,
protection, networks …
Machine’s own
programming language
Hardware: implements
instruction set
Spreadsheets, databases, your
own programs …
Computers
• A computer is a machine that executes sequences of instructions (programs)
which direct it to operate on (process) data.
• Strength: generality.
• Program instructs hardware to process incoming data in any chosen way.
Systems and Networks Introduction 6
Program
Processor
Data outData in
Systems and Networks Introduction 7
Different Kinds of Computer
• Personal computer
– Sits on a desk, serves one user.
• Server
– Designed to run services handling requests from many networked clients
simultaneously (e.g. web server, file server, email server, etc.)
• Embedded computer
– A component that adds functionality to a bigger machine.
– E.g. engine management unit in a car.
• High performance computer
– Use many processors that cooperate to solve large scale problems.
– May be a single machine with many processors (CPUs) or consist of many
computers cooperating over a network.
Data
• Data arise from use of number in modelling our environment.
• Numbers used in two ways:
– counting/labelling (Whole Numbers)
– measurement (Real Numbers).
• Results of labeling and measurements are data items. Sequences are data.
• A set of data items under discussion at a given time forms a data set.
Different types of data are drawn from different data sets.
• Some data sets are countable (e.g. finite data sets), others are uncountable.
• Because data too numerous or operations too time-consuming to process
mentally, we construct artificial data processing machines.
Systems and Networks Introduction 8
Representations
• Data representation involves finding suitable physical quantities to represent
numbers.
– need representations that can be stored (memory) in physical devices and
communicated between devices.
• In current technology electrical voltages are most commonly used.
– Easily stored and transmitted over wires.
– Other technologies are possible (e.g. optical).
• Computation involves designing devices to manipulate these physical
representations in ways that map onto useful operations.
• Machines work with representations not with data.
• Many representations are possible for the same data.
• Two distinct approaches:
– Analogue representations use continuous phenomena (measured to arbitrary accuracy)
– Digital representations use discrete phenomena (finite number of allowed measurable
values)
Systems and Networks Introduction 9
Programs
• Computers are general artificial data processing machines that can
perform sequences of operations under control of a pre-prepared
program.
• A program is a set of instructions detailing how input data should be
processed to achieve a desired result (output data).
• Instructions can be numbered so a program can also be numerically
represented.
• Programs may themselves be treated as data by other programs (e.g. a
compiler).
• Programs can be represented in hardware in the same way as data.
• Needs a machine able to interpret and execute the instructions in the
program.
Systems and Networks Introduction 10
Analogue Representations
• Analogue representations use continuous physical quantities
– assumed measurable to arbitrary accuracy.
– E.g. could represent the real number x, as x metres or x volts.
• But
– In reality measurement has limited accuracy and this limits the accuracy
of the representation.
– Noise in the environment also introduces errors which are hard to control.
• Analogue computers, once popular, have largely fallen out of
use.
• Very simple example: slide rule uses length as measureable
quantity.
Systems and Networks Introduction 11
Digital Representations
• Digital representations use discrete physical phenomena.
• Current technology favours binary representations with
two values of voltage, usually called low and high.
• In general the values are labelled 0 and 1 and are called
bits (BInary digiITS).
• Only need to be able to tell 2 values apart so superior
resistance to noise and errors.
• Can represent as many data items as required using
sequences (strings) of bits called code words.
Systems and Networks Introduction 12
Binary Codes
• A mapping from a data set to binary code words is called a binary code.
• Many codes can be defined on the same data set.
• Can represent any finite data set fully by using enough bits
• Can represent uncountable data sets (e.g. real numbers) to any desired
degree of accuracy (by using long enough code words).
• If all the code words have same number of bits, code is fixed length.
Systems and Networks Introduction 13
Systems and Networks Introduction 14
Computer Storage
There is a basic digital circuit that can
– Take a data bit and store it
– Remember the value indefinitely
– Read out the stored value
The computer’s memory consists of a large number of these basic circuits
Think of a bit storage circuit as a box that
– contains one bit
– can read out its contents
– can store a new bit value
This hardware behaves much like a variable in a high level language (HLL) like Java or C.
0
Systems and Networks Introduction 15
A byte is a string of 8 bits, e.g. 01101001
A byte is represented in the computer by 8 copies of the basic bit storage circuit.
There are exactly 28 = 256 different values that can be represented in a byte (see right).
Many different ways to utilise the information capacity of a byte.
Bytes
0 1 1 0 1 0 0 1
00000000
00000001
00000010
00000011
…
11111111
Systems and Networks Introduction 16
Words
A word is a larger amount of information. One common convention:
Short word 16 bits 2 bytes
Word 32 bits 4 bytes
Long word 64 bits 8 bytes
The term “32 bit architecture” means that the internal hardware uses 32-bit words
A word containing k bits is called a k-bit word, and can represent 2k distinct values.
Each CPU will have a characteristic word size which it can store and manipulate in a single
instruction. Early machines used 8-bits; today the norm is 64-bits.
Word Size Number of Values Approx.
8 28 = 256 102
16 216 = 65,536 105
32 232 = 4,294,967,296 109
64 264 = 18,446,744,073,709,551,616 1019
Some Questions
1. What data sets are involved in the following Java data
types: boolean, byte, short, char?
2. Design an 8-bit code for unsigned numbers. Now design
one for signed numbers.
3. Explain why digital representations have more resistance
to noise than analogue.
4. An 8-bit adder is a device that takes in two 8-bit code
words representing numbers and generates the 8-bit code
word representation of the sum of the numbers. Such a
device will sometimes fail to give the right answer.
Explain why.
Systems and Networks Introduction 17