1.
COMPUTER SYSTEMS AND COMPUTER
ARCHITECTURES
1.1 INTRODUCTION TO COMPUTER SYSTEMS: HISTORY AND BASIC ELEMENTS
• What is a COMPUTER?
Is a digital device that accepts information (in the way of digitalized data) and
manipulates it for some result based on a program, software, or sequence of
instructions on how the data is to be processed.
• Basic elements
Þ HARDWARE: Physical equipment
Þ SOFTWARE: consists of algorithms (detailed instructions telling what to do and
how to do something) and their computer representations: programs
o Operating systems
o Drivers
o Software applications
• Evolution of computer
Þ First generation (1942-1959): vacuum-tube machines (ENIAC)
o ENIAC (Electronic Numerical Integrator and Computer)
• 18,000 vacuum tubes and 1500 relays
• Weighted 30 tons and consumed 140kW
• Programmed --> setting up 6000 multiposition switches and
connecting a multitude of sockects with a veritable forest of
jumper cables
o Changing program --> changing physical connections (slow, tedious and
inflexible)
o Program represented as digital form in the computer’s memory
Þ Second generation (1959-1965): transistor machines (the IMB 7094)
o Use of TRANSISTORS
o The bus was introduced. Bus --> a collection of parallel wires used to
connect the components of a computer
o Batch operating system
Þ Third generation (1965-1975): early integrated-circuit machines (IBM 360)
o Use of SILICON INTEGRATED CIRCUIT (IC)
o IC allows docen of transistors to be put on a single chip (computers
smaller, faster and cheaper)
o Time sharing OS
Þ Fourth generation (1975-1988): personal computers with microprocessors (
Intel CPUs)
o Very Large Scale Integration (VLSI)
o Combining millions of transistors onto a single chip (Processors)
o Multiprocessing and GUI OS
Þ Fifth generation (1988-Present): more paradigm shift than a specific new
architecture
o Artificial intelligence (AI)
o Natural language processing
o Parallel processing
o ULSI technology
o Will result in very powerful and compact computers at cheaper rates
• KEY COMPONENTS OF HARDWARE
Þ Motherboard
o Funcionalities
• Most important component of a computer
• Provides physical interface of interconnection of the other
elements
• Allow communication between elements through the use of a
bus
• Example: MSI Z490-A PRO
• Connects the CPU to other components of the computer
o Main elements:
• CPU socket
• RAM (Memory) slots
• Connection to power supply
• SATA connectors
• Slots for Disk Driver, DVD-ROMs
• Bus Network: wires to allow components to communicate
• PCI slots (sound cards, graphic cards, network cards...)
• Graphic cards slots
• Back panel with connections for peripherals and USB memory
Þ CPU (Microprocessor): Central processing unit (processor)
o Is a chip responsible for calculations
o Makes all the logical decisions which are basicly all the digital task the
computer does
o Computer brain
o Handles large amounts of data and performs calculations at high speed
o Most important taks:
• Receives data from the input peripherals (keyboard, mouse...)
• Process data and run programs
• Sends the results to the output peripherals (monitor, printer,
speakers...)
o Most famous models: Intel and AMD
o Example: Intel Core i5-10600K 4.10GHz
o In the motherboard --> special socket, placed below the fan because
the processor is the element that heats up the most
o Main important features of CPU:
• Socket --> physical connection between the CPU and the
motherboard and responsible for transmiting energy to the CPU
• Core --> responsible for the processing speed
• Clock --> responsible defining the frequency CPU will use to
execute one task
• Cache --> the memory of the CPU where the most access data
of the processor is identified and store
Þ RAM memory:
o High speed memory which is able of storing the programs and data
required by the CPU during the execution of a program while providing
quick access to the processor
• Read / write memory
• Volatile memory --> Data is lost when the power is turned off
• Two main technologies:
o SRAM (Static Random Acces Memory)
o DRAM (Dynamic Random Access Memory)
§ Memory that contain capacitors, that have to be
refreshed with electricity constantly
o Placed on the motherboard, via dedicated sockets, in 1,2,4,6 or 8
socket configurations
o Stored on the motherboard in modules that are called DIMMs (Dual
Inline Memory Module), it has two independent roles of pins
o Is installed on the motherboard in the memory slots --> which will be
between 2 and 4 memory slots
o When the CPU requires information from the hard disk, it must be
loaded into RAM memory
o Increasin the RAM will make the computer run faster
Þ Bios
o Is a smaller set of chips that has replaced a larger amount of chips
o Non volatile
o It’s job is to control the data flow between the CPU, peripherals, bus
slots and memory
o Is a memory (ROM, EPROM or flash memory) which stores a program
to initialize the physical components when the computer is turned on
o Is also in charge of checking these components to find possible errors
or absence, like lack of RAM, CPU or hard disk
Þ Chipset
o Manages communications between the processor and the other
elements of the motherboard
o Has to be compatible with the CPU
o Usually formed by two chips:
• Northbridge
o Located near the CPU in the north of the chipset
o Directly connected to the CPU, the memory and the PCI-
E (graphic card)/ AGP
o Communication between the CPU, PCI-E / AGP and the
memory
o Faster than the Southbridge, due to the high speed
connections
• Southbridge
o Located in the southern of the chipset
o Connected to the PCI bus slots, USB ports, SATA
connections and the IDE
• The CPU to obtain info from the PCI needs to pass, through the
Southernbridge, the Northbridge and then to the CPU
Þ Bus
o A pathway or set of pathways that allows data and signals to travel
between components on the motherboard
o The higher the bus speed, the faster the computer can perform
o Front Side Bus
• The connection between the CPU and the northbridge chipset
Þ Ports
o Connectors that allow the interconnection of different elements
(peripherals, hard disk...) with the computer to be controlled by the
CPU
o Motherboard inner ports: (puertos internos)
• SATA port
o Allows the connection of hard drives and SSD units (up
to 6 or 10) to the motherboard
o Faster that the traditional IDE ports, reaching data
transfer rates of 600MB
• PCI / PCI express
o For connecting expansion cards
o PCI express is faster so it is mainly intended for the
connection of the graphics cards
o External ports
• PS/2
o For connection of the keyboard and mouse
(obsolete)=anticuado
• Parallel
o For connection of conventional printers (obsolete)
• Serial
o For connection of monitors, printers … (obsolete)
• USB
o Most common connectors for peripherals
• RJ-45
o Dedicated to the ethernet connection
• VGA, HDMI, DVI
o Mainly used for the monitor connection
• Mini-jack
o Audio connectors for speakers, microphone...
Þ Hard drive
Þ Expansion cards (sound, graphics, network...)
o Serve to extend the funcionalities of the computer
o Are connected to the motherboard via dedicated sockets
o Most relevant are:
• Sound card
o Allow the connection and management speakers,
microphone or any other audio device
o Allows managing input and output sounds
o Provides several connectors for audio devices
o 3 types
§ Integrated into motherboard
§ On board:
• Directly connected to the motherboard
using a PCI slot
§ External
• Normally connected via USB port
• It provides higher sound quality
• Graphic / video card
o Manages procedures related to graphic generation and
its displays on output devices like monitors
o Manages the generation and display graphics
o 2 types
§ Integrated into the motherboard
• Used the RAM memory of the computer
§ On board
• Directly connect to the motherboard
using a PCI-express slot
• Has its own memory, doesn’t need to use
the PC’s memory
• Network card
o Allow connection to internet or other computers
o Allows Internet connection and the communication
between several computers to share resources
o 3 types
§ Integrated into the motherboard
§ On board (Wifi)
• Provides wireless connection
§ On board (Ethernet)
• Used the RJ-45 connector to connect to
the Ethernet or to a private network
• USB card
o Provides USB connectors for connecting peripherals
o USB types
§ USB 2.0: 480 MB/s
§ USB 3.0: 4.8 GB/s
§ USB 3.1: 10 GB/s
§ USB type C: 10 GB/s
§ USB 3.2: 20 GB/s
§ USB 4.0: 40 GB/s
• Peripherals devices
Þ External devices which provide additional funcionalities to the computer
Þ Allow the computer to communicate with the outside world
Þ 3 different types
o Input peripherals: allow data to be entered into the computer
• Human data-entry devices
o Keyboard
o Optical mouse
o Trackball
o Touchpad
o Graphics Tablet
o Joystick
o Stylus
o Digital Pen (Smart Pen)
o Web Camera (Webcam)
o Microphone (Voice Recognition)
o Gesture Recognition
o Wii controller
o Microsoft Kinect
o Output peripherals: allow the computer to send information to the
outside world
• Monitors
o Organic LED (OLED)
o Flexible displays
• Printers
o Inkjet
o Laser
o Thermal
o Plotters
o 3D Printers
• Audio and video output
o Speakers
o Headphones
o Ebook reader (electronic ink)
o Pocket Projector
o VR Glasses
o Input/output peripherals: allow the introduction and extraction of
information from the computer
• Routers and mass storage devices
o Routers
o Flash memories
o External hard drive
• SOFTWARE
Þ Is intangible (que no puede ser tocado)
Þ Functionalities
o Data treatment
o Communication management between the user and the computer
o Resource management and optimization
Þ Most relevant types
o Operative systems
• Main software of the computer system
• It manages hardware resources, programs and applications
• Plays a key role as an intermediary between the user and the
computer
• Translates our instructions and commands into digital language
and vice versa
• Types
o Private
§ Only the developer is allowed to introduce
changes
o Free
§ Any user can modify, copy and distribute it
• Examples
o MS/DOS
§ Designed by Microsoft in 1981
§ It did not have a graphic interface and it was
controlled by commands
o Windows
§ International reference
§ Provides a graphical interface to facilitate the
communication between the user and the
computer
o MAC OC
§ Apple’s operating system for its personal
computers and laptops
o Linux
§ Free operating system
o iOS
§ Apple’s operating system for its mobile systems
(iPhone, iPad…)
o Android
§ Originally developed on a Linux Kemel
§ It has been optimized for smartphones and
tablets
o Drivers
• Each peripheral device has a specific program which needs to
be installed in order to allow the operating system to
communicate and control the device
• It is a good practice to keep the drivers updated because
updates usually correct malfunctions
o Application software (Apps)
• Software packages intended for the execution of specific tasks
• Types
o Free
§ It is open code and allows users to copy,
distribute and improve it
o Commercial
§ Programs or tools developed to be used under
license
• Examples
o Office programs
§ Text editors
• Microsoft Word, OpenOffice writer…
§ Spreadsheets
• Microsoft Excel, OpenOffice Calc…
§ Presentations
• Microsoft Powerpoint, OpenOffice
Impress…
o Browsers
§ Mozilla Firefox, Google Chrome, Opera, Safari…
o Image treatment
§ Paint, Photoshop, Corel Draw…
o Video editor or player
§ Vlc, Windows media player, Shotcut, OSB…
o Simulators
§ Crocodile clips, Cade Simu…
• METRICS
1.2 COMPUTER ARCHITECTURES
• What is a computer architecture?
o Is a branch (rama) of engineering that is responsible for the design,
manufacture and improvement of computers
o It works in the hardware area and the software area
o The objective is to achieve the highest performance at the lowest cost by
harmonizing each one of the aspects involved: algorithms, languages,
components, coding, communication…
o It goes beyond how the different elements are physically connected, but also
determines how the information is shared and processed to achieve the best
possible performance of the whole system
• Hardware abstraction
o CPU
o I/O: Input and Output
o ALU: Arithmetic Logic Unit
• COMPUTER ARCHITECTURE (Von Neumann architecture)
o The aim (el objetivo) of this architecture is to optimize the management of the
hardware and software elements of the computer system
o BUS SYSTEM
§ The components are connected through the bus, which is a collection
of parallel wires for transmitting address, data and control signals
§ Modern computers have multiple busses, mainly to reduce costs and
improve modularity
• Data bus to carry information
• Address bus to determine where it should be sent
• Control bus to determine its operation, commands and status
signals
§ Buses can be external to the CPU, connecting it to memory and I/O
devices, but also internal to the CPU
o MEMORY
§ Internal memory
• The memory is that part of the computer where programs and
data are stored and from which the processors can read and
write information
• Main memory is the only directly accessible to the CPU
• 4 main types of primary memory
o 1. Register Memory
§ Just 32 or 64 bits
o 2. Cache Memory
§ Small and fast
§ Volatile, uninitialized at start up
§ Stores frequent program instructions
§ Can be CPU integrated or a separate chip
§ Uses Static Ram Memory
§ Stores copies of data and instructions from RAM,
that’s waiting to be used by the CPU
§ Feeds the CPU of data while the CPU is receiving
from the RAM, so that there is no gap between,
and the information gets faster
• Level 1 cache (primary level): is located
on the processor
o Runs at the same speed as the
processor
o Fastest cache on the computer
• Level 2 cache
o Used to catch recent data
accesses from the processor that
were not caught by the level 1
cache
• Level 3 cache
o Used to catch recent data
accesses from the processor that
were not caught by the level 2
cache
o Shared between all the cores in
the CPU
o 3.Random Access Memory (RAM)
§ Volatile
§ Stores data loaded by active programs and the
operating systems
§ Connected to the central processing unit via a
memory bus
§ Primary memory
• A computer containing only such storage would not have a
source to read instructions from, in order to start the computer.
Non-volatile primary storage containing a small startup
program (BIOS) is used to bootstrap the computer, that is, to
read a larger program from non-volatile secondary storage to
RAM and execute it
o 4. Read-Only Memory (ROM)
§ Non-volatile
§ Used in the computer startup process
§ Secondary memory
• External memory
o Not connected directly to the CPU
o Uses and I/O Bus
o Types of secondary memory:
§ Magnetic Disk (HDD)
• High speeds à 7,200 rpm
• SATA interface
• SATA drives have transfer speeds of 6 Gbit /s
§ Solid-State Disk (SSD)
• No moving parts
• Use flash memory chips to store data
• Data transfer is very fast
• Very quiet and more energy efficient
§ Hybrid drives
• SSHD (Solid State Hybrid Drives)
• Combines the use of magnetic disks and flash memory
• Take advantage of the large capacity and low cost of hard
drives and the speed of SSD
• Firmware in the drive will learn and decide by itself, where
to store the data
• CENTRAL PROCESSING UNIT (CPU)
o Is the brain of the computer
o Controls what the computer does and is responsible for performing calculations
and data processing
o Function à is to execute programs stored in the main memory by fetching their
instructions, examining them, and then executing them one after another
CPU CYCLE
ARITHMETIC LOGIC UNIT à CPU ORGANIZATION
• CPU PERFORMANCE
o EXECUTION TIME
§ How can we measure the performance of a specific machine running a
specific program?
• Intuitively the machine (CPU) is said to be faster or has better
performance running a program if the total execution time is
shorter
• Thus, the inverse of the total measured program execution time is a
possible performance measure or metric
Performance = 1/(Execution Time) → [𝑃𝑟𝑜𝑔𝑟𝑎𝑚𝑠/𝑠𝑒𝑐𝑜𝑛𝑑 ] 𝑃𝑒𝑟𝑓𝑜𝑟𝑚𝑎𝑛𝑐𝑒′𝑠 𝑢𝑛𝑖𝑡𝑠
§ For a specific program compiled to run on a specific machine (CPU), we
have the following parameters:
• The total executed instruction counts of the program (I)
• The average number of cycles per instruction (CPI)
• Clock cycle of the machine (C, seconds per cycle (Periodo))
𝐼𝑛𝑠𝑡𝑟𝑢𝑐𝑡𝑖𝑜𝑛𝑠 (𝑎𝑝𝑎𝑟𝑡𝑎𝑑𝑜)
𝐶𝑃𝐼 = 𝑛 (𝑐𝑦𝑐𝑙𝑒𝑠/𝑖𝑛𝑠𝑡𝑟𝑢𝑐𝑡𝑖𝑜𝑛𝑠) × + . . . = 𝐴𝑣𝑒𝑟𝑎𝑔𝑒 𝐶𝑃𝐼
𝑇𝑜𝑡𝑎𝑙 𝑖𝑛𝑠𝑡𝑟𝑢𝑐𝑡𝑖𝑜𝑛𝑠 𝑐𝑜𝑢𝑛𝑡
1
𝐶𝑙𝑜𝑐𝑘𝑠 =
𝐹𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦
𝐸𝑇 = 𝐼 × 𝐶𝑃𝐼 × 𝐶
EXECUTION TIME COMPARISON à SPEEDUP
𝑂𝑙𝑑 𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒 𝐼!"# × 𝐶𝑃𝐼!"# × 𝐶𝑙𝑜𝑐𝑘 𝑐𝑦𝑐𝑙𝑒!"#
𝑆𝑝𝑒𝑒𝑑𝑢𝑝 = =
𝑁𝑒𝑤 𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒 𝐼$%& × 𝐶𝑃𝐼$%& × 𝐶𝑙𝑜𝑐𝑘 𝑐𝑦𝑐𝑙𝑒$%&
• MFLOPS : Million Floating-point Operation per second
o Is an addition, subtraction, multiplication or division operation applied to
numbers represented by a single or a double precision floating-point
representation
𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑓𝑙𝑜𝑎𝑡𝑖𝑛𝑔 − 𝑝𝑜𝑖𝑛𝑡 𝑜𝑝𝑒𝑟𝑎𝑡𝑖𝑜𝑛𝑠
𝑀𝐹𝐿𝑂𝑃𝑆 =
𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑡𝑖𝑚𝑒 × 10'
• MULTIPROCESSOR
o Is the use of two or more CPUs within a single computer system
o All CPUs share the common main memory as well as the peripherals. This
helps in simultaneous processing of programs: parallel computing
o Is regarded as a mean to improve computing speeds and performance, as
well as to provide enhanced availability and reliability
o Communication architecture of a multiprocessor:
§ Shared Memory (a)
• Processor communication is done by means of shared memory
read / write
• Convenient on small-scale devices
• Lower latency
§ Message Passing (b)
• Processor communication by means of message passing
• Processors include private memories
• Easier to design for hardware designers
• MULTCOMPUTER OR CLUSTERING
o Is a computer made up of several computers that are connected together to
solve a problem
o In a multicomputer architecture, each processor has its own memory, and it
is accessible by that processor and those processors can communicate with
each other via an interconnection network
o As the multicomputer can pass messages between the processor, it is
possible to divide the task between the processors to complete the task
o It can be used for distributed computing
o It is cost effective and easier to build than a multiprocessor / multicore
1.3 INFORMATION INSIDE THE COMPUTER
• COMPUTER-USER COMMUNICATION
o Computer only understands machine code à extremely difficult to
understand for the user
o To facilitate the communication and programming, it is necessary to use
different languages and have some element that translates the languages
o HIGH LEVEL CODE à COMPILER à MACHINE CODE
• MACHINE CODE
o Only language that a computer system understands
o It consists of sequences of digital values (0 and 1) that the processor can
interpret as simple commands
o Each processor uses its particular machine code
o A deep knowledge of the internal structure of the computer is needed to
operate on it
o The smallest addressable unit of
data à group of bits à 1 byte (8
bits)
§ The unit processed by
machine code instructions
is called a word (typically
32 or 64 bits)
• HIGH-LEVEL CODE
o Allow the representation more similar to the form of expression of the user
o Facilitate the programming task of the user but the codes are not directly
executable by the computer system
o A compiler is required
o Examples
§C
§ C++
§ Java
§ COBOL
§ FORTRAN
§ ADA
§ Pascal
§ Visual Basic
§ Python
• COMPILER
o It is a software that translates a high-level language code into machine code
• INFORMATION INSIDE COMPUTERS
o The instructions must be translated into machine code
o The data must be expressed as sequences of bits
o The user must indicate to the compiler the nature of each data (data type) in
order to ensure its optimal processing
§ Associating a type to a data implies defining the values it can take, what
operations can be performed with it, …
• DATA TYPES
o Integer
§ Can hold a mathematical integer
§ May be:
• signed (allowing negative values)
• unsigned (whole numbers only)
§ Number of values for n bits: 2n
§ Converting decimal integer to binary
• To encode a decimal number in
binary its only necessary to set
those bits whose values add up
to the value to encode
§ Converting binary to decimal integer
§ Converting decimal to hexadecimal
o Floating-point number
§ Used to represent non-integer fractional numbers (for example,
3,256…) and are used in most engineering and technical calculations
§ They are form of scientific notation that allow represent extremely
large and small real numbers in a very efficient and compact way
§ Also allow to perform arithmetic operations maintaining great accuracy
o Boolean
§ In a computing system, it is common to evaluate conditional
expressions in which it is evaluated if a condition is true or false
• True (1)
• False (0)
§ The basic operations are:
• AND à conjuction, multiplication
• OR à disjunction, addition
• NOT à negation
o Character
§ In a computing system, in many cases the data will be punctuation
marks, symbols, emojis, formatting codes or some other specialized
code
§ The data type for these elements is character
§ ASCII Table or Unicode Tables relates each character with its
interpretation in hexadecimal or decimal. In this way, the compiler
can translate the character into machine code
o String
23