It is composed by:
Input devices
CPU
Storage devices
Output devices
Input devices are used to enter data into a computer for processing. Without input devices there would be no way to enter information into a computer. All computers have at least one input device, but most will have multiple devices. There are many different input devices available, depending on the type of information that needs to be input.
Common mistakes that students do and you won't:
Input devices work with data, therefore, "electricity" or "cables" or "laptop charger" are not input devices. In a washing machine, "water" is not an example of input.
Input data comes from external sources. Therefore, transferring data from one computer to another (e.g., using a flash drive) is not an example of input. Instead, this is an example of data storage.
The input devices that you will study are:
Barcode scanner
Digital camera
Keyboard
Microphone
Optical mouse
QR code scanner
Touch screen (resistive, capacitive and infra-red)
Two-dimensional (2D) and three-dimensional (3D) scanners
Barcode scanners shine a light at a barcode and measure the reflected light to read the data. This is quicker than typing in the barcode number manually.
The type of information that a barcode processes is numeric.
A digital camera uses an image sensor to measure light and take a photograph, which is stored digitally on a device such as an SD card. Many digital cameras can record both still photographs and video.
Keyboards are one of the most common input devices, allowing users to type text and numeric data quickly. Keyboards may have a standard ‘qwerty’ layout, or they may be concept keyboards with custom layouts. For example, in a restaurant one key on a keyboard may order a drink and another may order a burger.
A microphone allows sound to be input. The sound could be recorded or used with voice recognition software to turn it into typed words or commands.
A mouse is commonly used to control a cursor or pointer on screen. Most mice have at least two buttons, but some have more.
The type of information that a mouse processes is movement.
A QR (Quick Response) code is similar to a barcode. It consists of a square black and white pattern which is capable of representing a small number of text characters (usually fewer than 100). QR codes are often used to store URLs to direct users to websites. A QR code is read using a digital camera which would be the QR code scanner.
Touch screens allow users to input data by pointing and touching options with their fingers. In some situations this might be more user-friendly that using a keyboard or a mouse.
Touch screens are very useful when a user must select from a small range of options. They are less useful if lots of text or numeric data needs to be input.
Touch screen technologies:
Capacitive
This is made up of many layers of glass that act like a capacitor, creating electric fields between the layers. When the top glass layer is touched, the electric current changes and the coordinates where the screen was touched are determined by an on-board microprocessor.
Some benefits are:
medium cost technology
screen visibility is good even in strong sunlight
it permits multi-touch capability
the screen is very durable
it takes a major impact to break the glass
Smart phones use this type of touch screen.
Drawbacks:
allows only the use of bare fingers as the form of input
although the latest screens permit a special stylus to be used.
Resistive
This makes use of an upper layer of polyester (a form of plastic) and a bottom layer of glass. When the top polyester layer is touched, both top and bottom layer complete a circuit. Signals are then sent out which are interpreted by a microprocessor, the calculations determine the coordinates of where the screen was touched. ATMs use this type of touch screen.
Some benefits are:
it is a relatively inexpensive technology
it is possible to use bare fingers, gloved fingers or a stylus to carry out an input operation
Drawbacks:
screen visibility is poor in strong sunlight
it doesn’t permit multi-touch capability
the screen durability is only fair; it’s vulnerable to scratches; the screen wears out through time.
Infrared
Infrared touch screen technology doesn’t overlay the display with an additional screen or screen sandwich. Instead, infrared monitors use infrared emitters and receivers to create an invisible grid of light beams across the screen. This ensures the best possible image quality. When an object interrupts the invisible infrared light beam, the sensors are able to locate the touch point.
Advantages:
highest image clarity and light transmission of all touch technologies
unlimited touch-life
impervious to surface scratches
Disadvantages:
accidental activation may occur because the infrared beams are actually above the glass surface
Dust, oil, or grease build up on screen or frame could impede light beam causing malfunction
Sensitive to water, snow, rain
May be sensitive to ambient light interference
Higher cost
A 2D scanner looks like a photocopier: documents are laid flat on the device and light is used to scan the document into a digital image.
OCR (Optical Character Recognition) software can scan text documents and turn them into editable text in a word processor.
A 3D scanner can take measurements of objects in order to create a 3D computer model of them. It does this by scanning an object using lasers to measure the dimensions (height, width, depth) of an object. The laser detects details about the shape of the object and converts this into digital data.
Sensors are input devices that read or measure physical properties.
Examples of sensors and their applications:
A proximity sensor can detect when an object is close, even if the objects are not touching. They are used in many situations where collisions need to be avoided. For example, many cars have proximity sensors to warn the driver if objects are very close to the front or rear of the car. Robots often have proximity sensors to help them detect collision hazards such as walls, other robots, or people who might be injured if they collide with the robot.
A moisture sensor measures the presence of water.
A level sensor uses a gyroscope to measure angular movement. This enables the sensor to detect if it is being tilted or rotated. A common application for these sensors is in smart phones which can be controlled by tilting or waving the device.
Flow sensors measure the flow speed of liquids or gases in pipes. For example, a reduced flow speed in a pipe might mean there is a leak in the pipe, and a flow sensor can be used to detect this situation.
It mesures acceleration force (the rate of change of velocity). They are often used in smart phones to detect movement (for example, when a game is controlled by moving the phone itself)
Cars with stability control systems also use accelerometers to measure the car's situation
Used to:
o Control a central heating system.
o Control/monitor a chemical process.
o Control/monitor the temperature in a greenhouse.
Used to:
o Control/monitor the moisture levels in soil in a greenhouse.
o Control/monitor the humidity levels in the air in a greenhouse.
o Monitor dampness levels in an industrial application (e.g., monitor moisture in a paint spray booth in a car factory)
Used to:
o Switch street lighting on at night and off during the day.
o Monitor/control light levels in a greenhouse.
o Automatically switch on a car’s headlights when it gets dark.
Used to:
o Turn on the windscreen wipers on a car automatically.
o Detect intruders in a burglar alarm system.
o Count people entering/leaving a building.
Used to:
o Detect intruders in a burglar alarm system.
o Weigh things (e.g. check the weight of a vehicle)
o Monitor/control a process where gas pressure is important.
Used to:
o Pick up noise levels (e.g. footsteps) in a burglar alarm system.
o Detect the noise of liquids dripping in a pipe.
Used to:
o Monitor pollution levels in a river or in the air.
o Measure O2 and CO2 levels in a greenhouse.
o Check for CO2 leaks in a power station.
Used to:
o Monitor/control acidity/alkalinity levels in the soil in a greenhouse.
o Monitor environmental pollution in rivers.
Used in:
o any application where detection of changes in a magnetic field is required (e.g. in cell phones, CD players)
o anti-lock braking systems in motor vehicles.
● Burglar alarm systems.
This type of system carries out the following actions:
o The system is activated by keying in a password on a keypad.
o The infra-red sensor picks up the movement of an intruder in the building.
o The acoustic sensor picks up sounds such as footsteps or breaking glass.
o The pressure sensor picks up the weight of an intruder coming through a door or through a window.
o The sensor data is passed through an ADC (Analogue to Digital Converter) if it is in an analogue form to produce digital data.
o The computer will sample the digital data coming from these sensors at a given frequency (e.g. every 5 seconds); the data is compared with the pre-set values (stored values).
o If any of the incoming data values are outside the acceptable range, then the computer sends a signal to:
▪ a siren to sound the alarm, or
▪ a light to start flashing.
o A DAC (Digital to Analogue Converter) is used if the devices need analogue values to operate them.
o The alarm continues to sound, the lights continue to flash until the system is reset with a password.
● Monitoring of patients in a hospital
o A number of sensors are attached to the patient; these measure vital signs such as: temperature, heart rate, breathing rate, etc.
o These sensors are all attached to a computer system.
o The computer samples the data at frequent intervals.
o The range of acceptable values for each parameter is keyed in to the computer.
o The computer compares the values from the sensors with those values keyed in.
o If anything is out of the acceptable range, a signal is sent by the computer to sound an alarm.
o If data from the sensors is within range, the values are shown in either graphical form on a screen and/or a digital read out.
o Monitoring continues until the sensors are disconnected from the patient.
● Measuring pollution in a river
o The sensors are placed in at least two different positions so that a pollution comparison can be made.
o The data from the sensors is converted into digital using an ADC and sent to a computer.
o The computer stores the received data.
o The oxygen levels and acidity levels are compared to the historical data stored in memory and they are also compared to pre-set levels stored in memory.
o The oxygen and acidity levels from the different positions in the river are also compared to see if they are similar - this is used to see if the source of the pollution can be found.
● Control of street lighting
A microprocessor is used to control the operation of a street lamp. The lamp is fitted with a light sensor which constantly sends data to the microprocessor. The data value from the sensor changes according to whether it is sunny, cloudy, raining or it is night time, etc.
o The light sensor sends data to the ADC interface.
o This digitises the data and sends it to the microprocessor.
o The microprocessor samples the data let’s say every minute.
o If the data value from the sensor is smaller than the value stored in memory:
▪ a signal is sent from the microprocessor to the street lamp
▪ and the lamp is switched on.
o The lamp stays switched on for 30 minutes before the sensor readings are sampled again (this prevents the lamp flickering off and on during brief heavy cloud cover, for example)
o If the data from the sensor is greater or equal than the value stored in memory:
o a signal is sent from the microprocessor to the street lamp
o and the lamp is switched off.
o The lamp stays switched off for 30 minutes before sensor readings are sampled again.
● Anti-lock braking systems (on cars)
ABS use magnetic field sensors to stop the wheels locking up on the car if the brakes have been applied too sharply.
o When one of the car wheels rotates too slowly (i.e. it is locking up), a magnetic field sensor sends data to a microprocessor.
o The microprocessor checks the rotation speed of the other three wheels.
o If they are different (i.e. rotating faster), the microprocessor sends a signal to the braking system:
▪ and the braking pressure to the affected wheel is reduced
▪ the wheel’s rotational speed is then increased to match the other wheels.
o Checking the rotational speed using these magnetic field sensors is done several times a second and the braking pressure to all the wheels can be constantly changing to prevent any of the wheels locking up under heavy braking.
o If one of the wheels is rotating too quickly, braking pressure is increased to that wheel until it matches the other three.
● Automatic oven/cooker
An automatic cooker/oven has temperature sensors and a number of controls to set the cooking time. First of all, the start time and end time (or the actual cooking time) are entered. Finally, the cooking temperature is selected.
The microprocessor checks the set time against the current time and when they are equal, the cooker/oven heating elements are switched on. Once the cooker/oven starts the cooking process, the microprocessor then constantly checks the end time against current time (the end-time may be a pre-set value entered by the user or it may be a value calculated by the microprocessor, based on the cooking time entered); when they are equal, the cooking process is stopped.
The microprocessor checks the temperature data sent from a sensor and turns the heating element on if the value is less than the pre-set value chosen by the user. If the temperature is greater than or equal to the pre-set value, then the heating element is switched off by the microprocessor.
Once the cooking process is finished, the microprocessor sends a signal to a beeper to make a beeping sound to indicate that the cooking cycle is completed.
● Central heating systems
In this heating system a gas supply is used to heat water in a boiler. A valve on the gas supply is controlled by a microprocessor and is opened if the heating levels need to be increased. A water pump is used to pump hot water around the central heating system whenever the temperature drops below a pre-set value.
So how does this work?
o The required temperature is keyed in and this is stored in the microprocessor memory (this is the pre-set value).
o The temperature sensor constantly sends data readings to the microprocessor.
o The sensor data is first sent to an ADC to convert the analogue data into digital data.
o The digital data is sent to the microprocessor.
o The microprocessor compares this data with the pre-set value.
o If the temperature reading is greater than or equal to the pre-set value then no action is taken.
o If the temperature reading is less than the pre-set value, then a signal is sent:
▪ to an actuator (via a DAC) to open the gas valve to the boiler.
▪ to an actuator (via a DAC) to turn on the water pump.
o The process continues until the central heating is switched off.
● Chemical process control
A certain chemical process only works if the temperature is above 70oC and the pH (acidity) level is less than 3.5. Sensors are used as part of the control system. A heater is used to heat the reactor and valves are used to add acid when necessary to maintain the acidity. How the sensors and computer are used to control this process is described below:
o temperature and pH sensors read data from the chemical process.
o this data is converted to digital using an ADC and is then sent to the computer.
o the computer compares the incoming data with pre-set values stored in memory if the:
▪ temperature is less than 70oC, a signal is sent to switch on the heaters.
▪ temperature is greater than or equal to 70oC, a signal is sent to switch off the heaters.
▪ pH is greater than 3.5, then a signal is sent to open a valve and acid is added.
▪ pH is less than or equal to 3.5, then a signal is sent to close this valve.
o the computer signals will be changed into analogue signals using a DAC so that it can control the heaters and valves.
o this continues as long as the computer system is activated.
Once a computer has processed data, the data needs to be shown in a human suitable form. Output devices are used to do this.
Output can be in the form of images, text, sound, movement, etc.
Common output devices are:
Projectors are commonly used to display images on large areas, such as a large screen or a wall. They are useful when the output needs to be viewed by multiple people such as in a classroom or a meeting room.
DLP projectors use thousands of tiny mirrors to reflect a digital image from a computer onto a screen. DLP projectors are usually smaller and more portable than LCD projectors.
LCD projectors create an image by projecting light in three primary colours: red, green, and blue. These colours are combined into a final image on the projector screen, LCD projectors produce higher quality images than DLP projectors.
LCD screens work by sandwiching crystals between two sheets of glass. A white back light illuminates the screen from behind. When the crystals are solid, light cannot pass through. When an electrical current is applied to the crystals in individual pixels, light is passed through and an image forms.
LED screens function in a similar way to LCD screens. The main difference is the type of back light. Instead of using a fluorescent backlight, LED displays use light emitting diodes to generate the light. This often results in better contrast.
LED screens generally produce better image quality than LCD screens, with better contrast and colour reproduction. They use less electricity than LCD displays, making them more cost effective in the long run. However, their initial cost is higher.
Printers are common output devices used to create paper copies (hard copies) of documents or images.
Inkjet printers use an an ink cartridge (or several cartridges if it is a colour printer). They spray tiny droplets of ink at a piece of paper to form an image. Inkjet printers are comparatively cheap and although they can be slow, they can produce very high quality images with excellent colour blending.
These type of printers use a laser to apply a static charge to areas on the paper. Toner (a powdered ink) is attracted to the static charge and sticks to the paper in these areas, forming an image.
Laser printers produce higher quality text documents than inkjet printers, but inkjet printers produce better quality colour gradations on images and photos. Laser printers can print faster than inkjets, but they are more expensive.
3D printers are relatively modern output devices that can print physical objects. They do this by building up thin layers of material layer by layer until the object is complete. Objects are usually created from plastic filaments (e.g. ABS or PLA plastic) or from resin.
A speaker produces output in the form of sound.
An actuator takes a digital signal and outputs it as a physical movement. For example, in an automatic door system the computer might send a signal to open the door and an actuator would convert this into a motor movement that causes the door to open.
According to some statistics, 90% of all data was created in the last two years. Every day, over 90 million photos and videos are shared on Instagram. 500 million tweets are sent on Twitter. 300 billion emails are sent. 720,000 hours of video are uploaded to YouTube (that’s 82 years of continuous watching!). Data is big – and growing! In this topic you will learn about the devices used to store data in computer systems, how they work, and the advantages and disadvantages of different storage devices.
Computer storage is divided into two main categories: primary storage and secondary storage. Primary storage is storage that is accessed directly by the CPU. This makes it faster to access than secondary storage, which is not directly accessible to the CPU. There are two types of primary storage inside a computer system: RAM and ROM.
RAM (Random Access Memory) is used for temporary storage of programs and data that are currently being used. RAM is extremely fast to access, which makes it ideal for this purpose. RAM is volatile, which means it loses its contents when the power is removed. This means data must be transferred to secondary storage for permanent storage. A typical modern computer has between 8 Gibibytes (GiB) and 32 GiB of RAM. RAM looks like short ‘sticks’ of microchips
ROM is a type of non-volatile storage, meaning it retains its data even when the power is removed. A computer typically has between 4 Mebibytes (MiB) and 8 MiB of ROM. This is more than sufficient to store the initial boot-up instructions.
The relationship between primary storage and secondary storage:
Secondary storage devices are not directly accessible by the CPU. This is the opposite to primary storage. People select different secondary storage devices based on their requirements. For example, a DVD is easily portable whereas a hard disk is not. However, a hard disk can contain a lot more data than a DVD.
Secondary storage is non-volatile, meaning data is retained even when the power is removed. This makes it ideal for permanently storing all of a user’s data and programs. For this reason, secondary storage devices have significantly larger storage capacities than primary storage. Modern computers often have several Tebibytes (TiB) of secondary storage, compared to a few Gibibytes (GiB) of primary storage.
When a program is run, it is copied from secondary storage (where it is stored permanently) to RAM (a type of primary storage) where it can be executed directly by the CPU. This approach combines the advantages of secondary storage (large capacity and permanent storage) with the faster speed of RAM (which allows for faster program execution).
Magnetic storage devices store data by applying a magnetic charge to a magnetized material. The most common example of magnetic storage is a hard disk drive. Inside a hard disk are multiple disks called platters, which spin constantly when the computer is on. A read/write arm moves in and out across the disk surface. An electromagnet on the read/write arm is used to read or write the data on the disk.
Magnetic tapes are an older form of magnetic storage that are rarely used in modern systems.
Magnetic hard disk drives are a very common type of secondary storage because they are comparatively cheap, relatively fast, and can hold large amounts of data. Disks with capacities up to around 12 Tebibytes (TiB) are available.
Optical storage devices use light to read and write data. Compact Discs (CDs), Digital Versatile Disks (DVDs), and BluRay disks are examples of optical storage. On the disk surface, there are microscopic ‘high’ and ‘low’ points, called ‘lands’ and ‘pits’. When a laser is pointed at the disk surface, the lands reflect light while the pits scatter light. This information is then interpreted as binary data by a light sensor.
To write data, a laser is used to create lands or pits in a layer of material on the disk surface. Earlier disk types such as CD-R and DVD-R were ‘recordable’, meaning data could be written to them only once. After this, the optical layer containing the lands and the pits could not be changed. Later technologies such as DVD-RAM allow data to be written multiple times.
Optical storage devices typically have comparatively low storage capacity. A DVD can hold about 8 Gibibytes (GiB) of data. BluRay disks store 25 GiB per layer, and are available in single, dual, triple, and quad layer formats, allowing up to 100 Gibibytes (GiB) of data per disk. They are also comparatively slow to access data. This means they aren’t suitable for everyday use, but they are helpful for longer term storage of data that is only occasionally used – for example, when backing up data on a hard disk drive.
Solid state storage devices come in many forms, including solid state drives, memory cards, and USB flash drives. Solid state devices store data using electronic circuits which are created using transistors. The state of these transistors (whether they are holding a charge or not) is used to represent binary data. There are different types of transistors used in solid state devices: older devices use NOR flash technology, while more modern devices use NAND flash technology. The primary benefit is that NAND technology takes up less physical space. This makes it easier to create higher capacity storage devices and easier to include storage in smaller, portable devices such as smart watches.
Solid state devices come in many forms. The first image above is a USB flash drive, followed by an SD memory card, and lastly a solid state drive (SSD)
Let's see now how a SSD works.
There may be times when a computer system has less RAM than is needed to perform a task. This might be because one program requires more RAM than the computer has, or it might be because multiple programs are running at once and consuming a large percentage of the computer’s RAM.
In these situations, the operating system software can use a system known as virtual memory. This involves using secondary storage as though it were RAM (primary storage). When more RAM than available is needed, a chunk of data called a ‘page’ is moved from RAM to virtual memory (secondary storage) (see figure below). This is called ‘paging out’ and frees up space in RAM. When that data is later needed again, the page must first be copied back from secondary storage to RAM (known as ‘paging in’).
Virtual memory allows an operating system to run programs that require more RAM than is physically available. However, a disadvantage is that secondary storage is significantly slower to access data than RAM, meaning the paging in and paging out process takes time and significantly slows program execution.
Cloud storage is a relatively modern type of storage. Instead of using local storage on a user’s computer (such as a hard disk drive), cloud storage uses servers on the Internet. When a user saves data, that data is sent across the Internet to a server, where it is stored. When a user opens a file, a request is sent to the server to retrieve the file again. This means that the user can access their files from anywhere with an Internet connection. However, because the data is not stored on the user’s local computer, they must have a working Internet connection to access their files.
The servers used for cloud storage are usually located in huge data centres that house thousands of servers (see figure below).
Cloud storage will be suitable for some situations and users, while local storage might be preferred in other situations. You can see a comparison of the features, advantages, and disadvantages of local storage and cloud storage below. As you can see, the advantages and disadvantages are relative and there is no one “perfect” solution for which is “better”.
Accessibility and portability
Local storage: data can be accessed on the local computer, meaning you have to take your computer or device with you. Data is accessible even if there is no internet connection.
Cloud storage: users can log in and access their data from any computer with an Internet connection. An Internet connection is required to access any data.
Speed
Local storage: accessing locally stored data is very fast.
Cloud storage: even with a fast internet connection, cloud storage will always be slower than local storage.
Security
Local storage: there is a risk of hardware failure, so users should always have backup copies of data.
Cloud storage: any data on the internet is potentially at risk from unauthorized access. However, most cloud service providers have excellent security features.
There is a risk of hardware failure in the data centre, so users should always have backup copies of data.
Capacity
Local storage: adding storage capacity may involve buying a new storage device and physically installing it in the computer.
Cloud storage: additional storage capacity can usually be added very quickly, simply by upgrading.
Cost
Local storage: initial costs may be higher, but there are no monthly costs.
Cloud storage: initials costs may be lower, but there are normally monthly fees, charged per Tebibyte (TiB)
Control and privacy
Local storage: data is fully under the user's control. Backing up data is the responsibility of the user, including having multiple copies in multiple locations, and ensuring backups are up to date.
Cloud storage: data is stored on a remote computer. This could be in a different country and could be subject to different laws, including different privacy laws. Backing up data is the responsibility of the cloud provider.
Other features
Cloud storage: some cloud providers add other features, such as the ability to work collaboratively on documents with other users. This is only possible because there is one central copy of the document.
Other issues
Cloud storage: there are environmental concerns about the energy use of data centres, which must be operating 24/7 to provide access to their users' data.
The CPU is often considered to be the ‘brain’ of a computer system. Whether we are playing a simple video game or performing a complex weather simulation, the CPU is responsible for all processing that occurs in a computer.
A CPU, also known as a microprocessor, is a special integrated circuit contained on a single chip. In the figure below we can see a closeup of a CPU and the electronic pathways inside it. This electronic circuit enables the CPU to accept data and instructions that have been input, and process them (such as performing calculations) ready for output. For example, a list of grades might be input using a keyboard. The CPU might process these by totaling the grades and calculating the average, and then the result could be output on a screen.
Without a CPU, no processing can take place and a system cannot be considered to be a computer. For example, a simple light might have a switch for input and a light bulb for output, but without a CPU to process data, we cannot consider this system as a computer.
A CPU is made up of several key components. These components work together to receive data and instructions that have been input, perform calculations, and prepare data for output. The components of the CPU are shown in the following figure:
Each component performs an individual task, as described below:
Control Unit (CU): manages the other components of the CPU and the overall operation of the CPU. This includes initiating each step of the fetch-decode-execute cycle and managing the ALU.
Arithmetic and Logic Unit (ALU): responsible for carrying out mathematical calculations or logical operations such as the bitwise shifts. The ALU will use the Accumulator register (ACC) to temporarily store data while performing these calculations.
Registers: small areas of storage found within the CPU. The register size depends on the CPU model, but 32-bit (4 byte) and 64 bit (8 byte) registers are common. Registers are extremely fast to access (even faster than RAM) because they are located directly within the CPU. Some registers have a dedicated purpose, as described below:
Program Counter (PC): holds the address (memory location) of the next instruction to be fetched.
Memory Address Register (MAR): is used when reading data from RAM or writing data to RAM. The MAR will contain the address of the RAM location to be written to or read from.
Memory Data Register (MDR): is also used when reading and writing data to/from RAM. The MDR will contain the data to be written to RAM, or the data that has just been read from RAM.
Current Instruction Register (CIR): holds the instruction which is currently being decoded or executed.
Accumulator (ACC): is used to hold data being worked on by the ALU. For example, if the ALU is performing an addition operation, the first number may be stored in the accumulator while the second number is fetched. The ALU can then add the two numbers and store the result in the accumulator.
The components of the CPU need to communicate with each other and with RAM. A bus is a way of communicating between two components: they can be thought of as a set of wires or as an electronic pathway. A CPU has three different buses to carry different types of signal:
Control Bus: Carries control signals from the Control Unit to other components of the CPU. It also carries control signals (e.g., “read” or “write”) from the CPU to RAM.
Address Bus: Carries addresses from the Memory Address Register to RAM, to indicate which address will be selected. The address bus is a unidirectional bus - it only carries addresses in one direction (to RAM).
Data Bus: During a write operation, the data bus carries the data to be written from the Memory Data Register to RAM. During a read operation, the data bus carries data from RAM to the Memory Data Register. The data bus is bidirectional - it carries data to RAM and from RAM.
The three buses work in conjunction to read data from RAM or write data to RAM.
In the figure below, the signals will be sent along each bus to write the value ‘50’ to location ‘10’ in RAM:
● The address bus will carry the value 10
● The data bus will carry the value 50
● The control bus will send a ‘write’ signal
Early computer programs were hard-wired. To reprogram a computer one needed to change the hardware switches manually, that took a long time and there were potential errors.
Computer memory was only used for storing data.
The principle of the Von Neumann architecture is that data and programs are stored in the same memory.
Programs are fetched from memory for execution by the CPU.
Programs and data are represented in memory in the same way.
The instructions in memory are fetched one at a time.
It has a Central Processing Unit (CPU). The purpose of the CPU is to fetch, decode and execute instructions.
The CPU consists of the following components:
- Control Unit (CU)
- Arithmetic Logic Unit (ALU)
- Cache, provides fast access to frequently used instructions and data.
- Registers: Program Counter (PC), Memory Address Register (MAR), Memory Data Register (MDR), Accumulator (ACC).
Fetch
An instruction and the necessary data are obtained from memory.
To fetch an instruction the CPU follows this process:
The Program Counter (PC) contains the address of the next instruction to be fetched
The content of the PC is copied to the Memory Address Register (MAR)
The PC is incremented by 1, so that it still points to the next instruction
The address bus carries the value in the MAR to RAM
The control bus sends a 'read'signal to RAM
The data bus carries the contents of the desired RAM address from RAM to the Memory Data Register (MDR)
The content of the MDR is copied to the Current Instruction Register (CIR)
Decode
The Control Unit decodes the instruction that is in the CIR.
Execute
The instruction is performed, the data is manipulated, and the results are stored. If the instruction is a mathematical operation then the instruction is sent to the Arithmetic Logic Unit (ALU). The ALU may use the Accumulator (ACC) to temporarily store its results.
Computers are complex machines capable of fetching and executing instructions billions of times in one second
The computer memory unit is made up of a number of partitions. Each partition consists of an address and its contents. The example shown here uses 8 bits for each address and 8 bits for the content. In a real computer memory, the address and its contents are actually much larger than this.
Each instruction is stored in a location in memory. Each location in memory has an address.
Exercise 1
Exercise 2
The speed at which the CPU can perform the fetch-decode-execute cycle directly affects its performance. The more cycles that can be completed each second, the faster the programs will run. The three main factors that affect the performance of a CPU are the clock speed, the number of cores, and the size of the cache.
Clock speed: the ‘clock speed’ of a CPU is measured in Gigahertz (GHz). Generally speaking, the clock speed determines the number of cycles a CPU can perform each second. For example, a CPU with a 3 GHz clock speed can perform 3 billion cycles per second.
Higher clock speeds generate more heat and use more energy, so modern CPUs often vary their clock speed by lowering it when performing a less demanding task. Despite this, the power and heat issues mean it isn’t possible to keep increasing CPU clock speeds indefinitely. Instead, other methods are used to further increase CPU performance.
Cores: A core is a processor within a CPU. As we have seen above, a core can only work on one instruction at once. This limited the performance of earlier CPU designs, as they only had one core and thus could only execute one instruction at once.
However, in the early 2000s CPU designers such as Intel started to develop multi-core CPUs. Dual-core CPUs contain two cores, enabling the CPU to work on two instructions simultaneously, thus increasing performance. Modern CPUs usually have between 2 and 16 cores.
However, due to the nature of computer programs, doubling the number of cores in a CPU does not necessarily double the CPU’s performance. Multi-core CPUs are useful for running several tasks simultaneously, but individual programs often have instructions which must be run in sequence and don’t benefit significantly from multi-cores.
Cache: cache is extremely fast memory that is located within the CPU. It is used to store temporary copies of the data in the most commonly accessed RAM locations. When the CPU tries to read data from a memory location (address), it will first check if that location exists in cache. If it does, it will access the data from cache instead. This is known as a ‘cache hit’. If the data does not exist in cache, it will be accessed from the comparatively slower RAM. This is known as a ‘cache miss’. Most modern CPU designs have between 2 and 16 mebibyte (MiB) of cache.
A CPU can only process a specified set of instructions. These instructions are chosen by the designers of the CPU and are known as the instruction set. They are written in binary, which is called as machine code.
The instruction set contains the most basic instructions required to write programs. For example, an instruction set might include instructions to perform the following tasks:
ADD – Add two numbers together
SUB – Subtract two numbers
INP – Input data from an input device
OUT – Output data to an output device
LOAD – Load data from RAM
STORE – Store (save) data to RAM
All programs that the CPU executes must use only the instructions in the instruction set. Instructions can be combined to perform more complex operations. For example, in the list above there is no instruction to add three numbers. However, this operation can be achieved by using the ADD instruction twice. Similarly, there is no instruction to multiply or divide numbers, but these operations can be achieved through multiple ADD or multiple SUB instructions, respectively.
An embedded system is a computer system that performs a dedicated function inside another device or appliance. Embedded systems don’t look like standard desktop or laptop computers – they often don’t have a keyboard or a screen - but they still have the components identified earlier (input device, CPU, primary memory, secondary memory, output device)
Examples of embedded systems are:
Embedded systems can commonly be found in areas such as:
● Automatic Teller Machine (ATM) / cash machine
● Entertainment systems in cars
● Stability control, traction control, and anti-lock braking systems in cars
● Domestic appliances such as washing machines
● Security systems (e.g. automatic lighting and alarms)
● Automatic road toll systems
● Digital cameras, which have embedded systems for processing images
● Vending machines
● Interactive digital assistants
It should be clear from these examples that embedded systems perform a single, specific function, which is why they are known as dedicated systems. This is the opposite to a laptop or desktop computer which can perform a wide range of functions and are known as general purpose computers.
Advantages:
● Easy for mass production
● Highly reliable
● Small in size
● Less expensive
● Fast operation
● Has improved product quality
● Has low power operation.
Disadvantages:
● Hard for maintenance as it is use and throw device
● It has no technological improvement
● Less power supply durability if it is battery operated
● It is hard to take backup of embedded files.
Billions of people and devices have Internet connectivity worldwide. People connect using a variety of devices, from desktop and laptop computers to smart phones and even watches. In this topic you will learn which hardware is required to connect any computer to a network, and how that hardware works.
Any computer joining a network needs to have a Network Interface Card.
A Network Interface Card (NIC) is a hardware device that is needed to connect a computer to a network. Network Interface Cards may have an Ethernet connector, allowing a computer to connect to a router using a cable. Some cards also have wireless capabilities, allowing a computer to join a network by connecting to a wireless router, without using cables. Most modern computers come equipped with Network Interface Cards built in.
All Network Interface Cards have a unique address assigned to them when they are manufactured. This address is known as the Media Access Control (MAC) address. MAC addresses are unique for every network card created and they cannot be altered.
A MAC address is 48 bits long and is usually written in hexadecimal for convenience. The first 24 bits of the address are the manufacturer code and the second 24 bits are a serial number assigned by the manufacturer.
An example of a MAC address:
00:A0:C9:23:A3:12
If a computer has a Network Interface Card with an Ethernet connector and wireless capabilities, it will have two MAC addresses – one for each connection method.
You learnt that hexadecimal notation is used to make it easier to read long binary numbers. Just like any hexadecimal number, MAC addresses can be written in binary:
00:A0:C9:23:A3:12
0000 0000 : 1010 0000 : 1100 1001 : 0010 0011 : 1010 0011 : 0001 0010
An Internet Protocol address (IP address) is a unique address assigned to each computer on a network. IP addresses are essential for identifying and managing computers on the network. A computer may be assigned a static IP address, meaning it is given the same address every time it joins the network, or it may have a dynamic IP address, meaning it is assigned any available address when it joins the network.
Most home users have a dynamic IP address which will be assigned by their Internet Service Provider (ISP) when they connect to the Internet. This is a benefit for the ISP as it allows them to only assign IP addresses when they are actually needed, and there are no drawbacks for the customer.
Static IP addresses are often used by businesses, particularly websites. When users connect to a website, the IP address for that website is found using a system called Domain Name System (DNS). This process occurs faster and more reliably if a website’s IP address never changes (i.e. it is static). Internet Service Providers usually charge extra to provide a static IP address.
IP addresses use either IPv4 or IPv6 (version 4 or version 6) systems. IPv4 addresses are 32-bit addresses and look like the example below.
200.67.53.43
Despite IPv4 allowing over 4,000,000,000 IP addresses, available addresses were running out, which led to the development of IPv6. IPv6 addresses are 128 bits (16 bytes) long, allowing 2128 possible addresses, which should be sufficient for some time. An IPv6 address looks like the example below, written in hexadecimal:
0123 : 4567 : 89ab : cdef : 0123 : 4567 : 89ab : cdef
Routers are hardware devices used to connect devices together to form a Local Area Network (LAN). They can also be used to connect multiple LANs to each other to form a Wide Area Network (WAN). Routers typically have between 4 and 12 ports to connect computers using Ethernet cables, and many routers also offer wireless connectivity
A network may have more than one router, and large networks may have many routers.
Routers can perform a number of roles on a network:
● They allow devices to connect to a Local Area Network
● They can assign IP addresses to devices joining a Local Area Network
● They connect a Local Area Network to the Internet
● They send (route) data to the correct destination on a network.
One essential role of routers is sending data to the correct destination on a network. When packets of data are sent from one device to another on a network, the sender and receiver’s IP addresses are included in the packet header. The router uses this information to ensure each packet is sent to the correct device. If there is more than one route to the destination device, the router will attempt to find the most efficient route. This might mean the route with the fastest connection or the route with the least traffic. It is even possible to send some packets via different routes, and they will be automatically recombined at the destination.