Unit 3 Flashcards
CPU or microprocessor
A CPU (Central processing unit) is also known as a microprocessor, an integrated circuit contained on a single chip. It processes instructions and data that are input into the computer so that the result can be output.
Von Neumann Architecture
The Von Neumann Architecture is a design of stored-program computer (programs stored electronically). Both data and instructions are stored in the same memory unit.
This makes it much quicker to perform different tasks on the same computer. It uses the fetch-execute cycle at an extremely fast rate (billions of instructions per second in modern computers).
Computer architecture
-> It refers to the internal, logical structure and organization of the computer hardware (the physical components of a computer system).
Components of CPU (non-registers)
Control unit (CU) – Manages fetch and decode tasks and storing results; provides clock & control signals.
Arithmetic logic unit (ALU) – Performs basic mathematic and logical operations (integer value only). Float point unit (FPU) performs arithmetic on non-integer values.
Cache memory (IAS) – Fastest memory; small capacities; temporary stores instructions waiting to be processed.
Registers
Registers are small areas of storage found within the CPU. Registers are extremely fast to access because they are located directly within the CPU.
Program counter (PC) – holds the address (memory location) of the next instruction to be fetched. Increments once instruction has been fetched.
Memory address register (MAR) – Stores address of current memory location (in RAM) for data or instruction to be fetched from/sent to.
Memory data register (MDR) – Stores data or instruction fetched from RAM or data waiting to be written to RAM
Current Instruction Register (CIR) – Stores the instruction which is currently being decoded or executed
Accumulator (ACC) – Hold the data being worked on by the ALU and stores the result of the operations.
Read operation – retrieving data from memory
Write operation – storing data to memory
Buses
. A bus is a way of communicating between two components; ram and cpu
Address bus - carries addresses from the MAR to RAM, to indicate which address will be selected. The address bus is a unidirectional bus.
Data bus - During a write operation, the data bus carries the data to be written from the MDR to RAM. During a read operation, the data bus carries data from RAM to the MDR. The data bus is bidirectional.
Control bus - carries control signals from the CU to other components of the CPU. It also carries control signals (e.g. ‘read’ or ‘write’) from the CPU to RAM.
FDE cycle
Fetch stage:
- The PC contains the address of the next instruction.
- The contents of the PC are copied to the 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 MDR,
- The contents of the MDR are copied to the CIR
Decode:
- The Control Unit (CU) decodes the instruction in the CIR.
Execute:
- The instruction is sent to the ALU to be executed.
- The ALU may use the ACC to temporarily store its results.
Factors affecting cpu performance
Clock speed – the number of cycles a CPU can perform in a second, measured in gigahertz (GHz); 1 GHz = 1 billion cycles per second. The more cycles that can be completed in the CPU each second, the faster the programs will run.
Core – a processor within a CPU. A single core can only execute one instruction at once. However, 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 software may not be developed to use multiple cores. If engineered to use just one, the other ones will stay idle and thus no improvement in CPU performance.)
Cache – extremely fast memory located within the CPU. It is used to store temporary copies of the data in the most 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’.
Instruction sets
-> Instructions chosen by the designers of the CPU. They are written in binary and are also referred to as machine code.
Embedded systems vs general purpose computers
-> a computer system that performs a dedicated functions inside another device or appliance, usually just a single microprocessor with limited functionality.
Embedded systems are found in many common devices and appliances, including:
- Security systems, such as automatic lighting and alarms
- Entertainment systems in cars
- Domestic appliances, such as washing machines.
Embedded systems are limited to performing a single, specific function which they were designed for, which is why they are known as dedicated systems.
On the other hand, general purpose computers are only limited by their CPU and storage, and in theory can be programmed to perform any function.
Advantages of embedded systems over general purpose computers:
- Cheaper: reduced size and cost
- Improved performance
- Increased reliability
- Simple interface
Touch screen: resistive, capacitive, and infra-red
Resistive touch screens use two very thin metal sheets over the screen. When the user applies pressure to the screen these two metal sheets make contact, completing an electrical circuit. This can be used to detect exactly where the user pressed.
Capacitive touch screens use a transparent layer over the screen. This layer is sensitive to the static electrical charge in the human body. When the user touches the screen, this charge is detected, and the touch location can be determined. (dont work with gloves)
Infra-red touch screens create a grid of infra-red (IR) light over the screen. This grid is invisible to users. When the user touches the screen, the light beams are broken. This information can be used to detect the location of the touch.
Printers
Inkjet printer:
- Spray tiny droplets of ink to form pictures
- Cheap, slow, produce better quality colour gradations
Laser printer:
- Laser to apply static charge. Toner is attracted to charge and stick to paper
- Higher quality text documents, expensive
Projectors
LCD (liquid crystal display) projector:
- Create image by projecting RGB colours
- Higher quality images
DLP (digital light processing) projector:
- Use lots of tiny mirrors to reflect digital image from computer onto screen
- Portable
Displays (screens)
LCD displays:
- Sandwiching crystals between 2 sheets of glass
- White back light from behind, light pass through and form image
LED (Light emitting diode) displays:
- Same, but instead of backlight, it uses light emitting diodes to generate light
- Better contrast and colour reproduction; use less electricity; cost effective
- high initial cost
Type of sensors
- Acoustic – detects sound in and out of human hearing range
- Used in burglar alarms (detect a break in) - Accelerometer – measures acceleration force(rate of change of velocity)
- In smartphones to detect movement
- In cars with stability control to measure the car’s situation - Flow - measures flow speed of liquids or gases in pipes
- Can be used detect reduced flow speed that indicates leak in pipe - Gas – detects presence of different gases
- Detect toxic gases in a chemical manufacturing plant
- Detect oxygen levels in the air - Humidity – detects water vapour in the air
- In air conditioning or environmental control systems (greenhouse)
- Art galleries - Infrared (active) – special type of light sensor that detects invisible infrared light, used to detect movement
- In automatic door systems
- Alarm systems
Infrared (passive) – detects heat radiating off object or presence
- Used for night vision technology - Level – uses gyroscope to measure angular movements, detecting if it is being tilted or rotated
- In smartphones and for leak detection - Light sensor – detects light levels, invisible and visible
- Automatic lighting systems
- Scanners or barcode reader - Magnetic field – measures strength of magnetic field
- In magnetometers (compass)
- Geophysical surveys - Moisture – detects presence of water inside a material
- In greenhouse
- Farming- Pressure – measures pressure of gas or liquid in pipe or measures the weight pushing down on it
- Traffic light control
- Blood pressure checks
- Proximity – detects distance from object
- In robots or cars
- Temperature – measures heat energy
- Central heating system to regulate temperature
- Engine management to prevent overheating
14. pH – detects how alkaline or acidic a substance is - swimming pools, aquariums, or chemical factory
- Pressure – measures pressure of gas or liquid in pipe or measures the weight pushing down on it
Sensor work
- A sensor detects and collects data from the environment, usually in an analog form.
- The analog data is converted into a digital format using an Analog-to-Digital Converter (ADC), allowing the microprocessor to process the information.
- The digital data is sent to a microprocessor.
- The microprocessor compares the data and checks whether it falls within an acceptable range.
- If the data is within the acceptable range, no action is taken.
- If the data is outside the acceptable range, the microprocessor sends a signal (usually in digital form) to an actuator. - If the actuator requires an analog signal, a Digital-to-Analog Converter (DAC) is used to convert the digital signal to an analog signal, allowing the actuator to perform the required action.
- The cycle continues.
Primary vs secondary storage
Primary storage 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 (Cache is technically also primary but like not really-)
Random access memory (RAM):
- Stores programs and data that are currently being used
- Volatile – cut off electricity = loses its content
- Modern computer has between 8-32 GiB of RAM
- Can read and write
Read only memory (ROM):
- Stores booting (boot-up) instructions known as BIOS
- Non-volatile – cut off power = retains its data
- Modern computer has between 4-8 MiB of ROM
- Contains data that can be read but cannot be altered
Secondary storage:
- Non-volatile
- Modern computer has several TiB of secondary storage
- When a program is running, it is copied from secondary storage to RAM where it can be executed directly by the CPU which allows for faster program execution.
Magnetic storage
- Store data by applying a magnetic charge to a magnetized material
- Examples: HDD and magnetic tapes
- HHD: Cheap, slower than SSDs, and can hold large amounts of data
- Inside a hard disk are multiple disks called platters, which spin constantly when the computer is running.
- A read/write arm moves in and out across the disk surface, and an electromagnet on the read/write head is used to read and write the data on the disk.
Optical storage
- Use light to read and write data
- E.g. Compact disks (CDs), Digital versatile disks (DVDs) and Blu-ray Disks
- Low storage capacity, slow to access data, only useful for long term storage of data that are only occasionally used (back up), portable
- Write: laser is used to create lands or pits in a layer of material on the disc surface
- Read: On the disc surface, there are microscopic ‘high’ and ‘low’ points, called ‘lands’ and ‘pits’. When a laser is pointed at the disc surface, the lands reflect light while the pits scatter light. This information is then interpreted as binary data by a light sensor
Solid–state storage
- Stores data using electronic circuits created using transistors that is used to represent binary data
- E.g. Memory cards, USB flash drives, Solid-state drive (SSD)
- Transistors: older devices use NOR flash technology, while more modern devices use NAND flash technology.
- NAND technology takes up less physical space makes it easier to create higher capacity storage devices and include storage in small portable devices such as smart watches.
- This consists of transistors with a control gate (to set the transistor charge) and a floating gate (to retain the charge when disconnected from power).
- No moving parts, durable, but needs to be replaced occasionally, silent, expensive, lightweight
Virtual memory
There may be times when a computer system has less RAM than is needed to perform a task. In these situations, operating system software can use a system known as virtual memory.
Swapping or paging:
1. When the RAM is full, the OS chooses parts of the data in RAM that haven’t been used recently and moves this data to the secondary storage, into the swap/page file. This process is called paging out.
- By moving data from RAM, the OS frees up space in primary memory for other programs or processes that require it.
- If a program needs data that was previously paged out to the swap file, the OS will load that data back into RAM from the secondary storage (this is called paging in), possibly swapping out other data to make room.
Disadvantage:
- 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 vs local storage
Cloud storage:
- Uses servers (computers) on the internet
- Saves data: data is sent across the internet to a server and stored
- Opens a file: a request is sent to the server to retrieve the file again
Advantages:
- Can access data from any computer and internet connection
- Backing up data is responsibility of cloud provider
- Have ability to work with others on documents
- Additional storage capacity can be added very quickly
Disadvantages:
- Requires internet connection
- Slower access than local storage
- Potential risk from unauthorized access
- Environmental concerns about energy use of data centers that operates 24/7 to provide user constant access to data
- Initial costs may be lower, but there are normally monthly fees
Local storage advantages:
- Fast access of data
- Data is accessible even with no internet connection
- Initial costs may be higher, but there are no monthly costs
- Data is fully under the user’s control
Disadvantages:
- Risk of hardware failure
- Adding storage capacity may mean buying new storage device
- Backing up data is the user’s responsibility
NICS
-> A hardware device that is needed to connect a computer to a network, often build into the motherboard.
Network interface cards may have:
- an ethernet port, allowing a computer to connect to a router using a cable
- wireless capabilities, allowing a computer to join a network by connecting to a wireless router, without using cables
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.
MAC Address
MAC address is 48 bits long and is usually written in hexadecimal (6 pairs of hexadecimal numbers seperated with colon)
The first half of the address are the manufacturer’s code, and the second half is the serial number.
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 device connected to network is called a node.
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.
Home users usually get a dynamic IP address, which changes each time they connect to the internet. This helps ISPs manage IP addresses efficiently and doesn’t cause problems for users.
Businesses often use static IP addresses, which stay the same. This makes it easier and faster for websites to be found online using the DNS. ISPs may charge extra for static IPs.
IPv4 address:
- Allows over 4 billion IP addresses
- 32 bits
- 4 sets of numbers separated by dots (between 0-255)
- E.g. 192.168.0.1 or 200.67.53.43
IPv6 address (more modern):
- Allows over 340 trillion trillion trillion combinations
- 128 bits (1 nibble = 1 hexadecimal number)
- 4 groups of 8 hexadecimal numbers separated by colons
Routers
-> 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).
(Definition sounds like NICs but routers don’t directly connect devices to the network, they help manage network connection)
Routers can perform several roles on a network:
- They allow devices to connect to a LAN
- They can assign IP addresses to devices joining a LAN
- They connect a LAN to the internet
- They send (route) data to the correct destination on a network
Routers typically have between 4 and 12 ports to connect computers using ethernet cables, and many routers also offer wireless connectivity (a cable connecting to internet, others to devices, or wireless connectivity).
The main role of a router is packet switching, sending data to the correct destination on a network.