Chapter 3 Hardware PDF

Summary

This document is a chapter on hardware focusing on computer architecture, CPU, components, and Von Neumann Architecture. It includes details about system clock, faster execution, and registers with relevant diagrams and tables. The document appears to be part of a larger course material.

Full Transcript

Chapter 3 Hardware Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Computer Architecture: CPU: Prepared By: Sir Haydar Integrated Circuit / Processor Miss Hunaisa (Deputy Head Teacher)...

Chapter 3 Hardware Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Computer Architecture: CPU: Prepared By: Sir Haydar Integrated Circuit / Processor Miss Hunaisa (Deputy Head Teacher) Under the Supervision of Cambridge Section Central component Responsibility of execution/processing of instruction and data Its is based on “Von Neumann Architecture” CPU components: CU Prepared By: Sir Haydar Under the Supervision of ALU (+,-,/,x)(OR,AND,NOT) Miss Hunaisa (Deputy Head Teacher) Cambridge Section Register and Busses CU: Interprets instructions whose address is already stored in PC (program counter) Interpretation is done by using fetch and execute cycle. CU reads the instruction from memory. CU ensures synchronization of data flow and instruction in computer. It generates signals to the components to ensure execution of instructions. Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Von Neumann Architecture (Stored Program Computer): Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Features: Cambridge Section The concept of a central processing unit (CPU or processor) The CPU was able to access the memory directly Computer memories could store programs as well as data Stored programs were made up of instructions which could be executed in sequential order. System Clock: System clock is used to produce timing signals on the control bus to ensure this vital synchronization takes place – without the clock the computer would simply crash! Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Faster Execution: Cambridge Section CPU takes instruction from ROM and put them into RAM (READ/WRITE) for faster execution. Registers and busses: Register are of two types: Prepared By: Sir Haydar Under the Supervision of General purpose registers Miss Hunaisa (Deputy Head Teacher) Cambridge Section Special purpose registers Register Abbreviation used Function/purpose of register current instruction CIR this register stores the current instruction being decoded and executed register accumulator ACC this register is used when carrying out ALU calculations; it stores data temporarily during the calculations memory address MAR this register stores the address of the memory location currently being read from or register written to memory data/ MDR this register stores data which has just been read from memory or data which is about buffer register to be written to memory program counter PC this register stores the address where the next instruction to be read can be found System buses and memory: Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Memory: Memory consist of a number of partitions. Each partition consist of address and its Under Prepared By: Sir Haydar the Supervision of contents. Miss Hunaisa (Deputy Head Teacher) We will use 8 bit for address and 8 bit for Cambridge Section contents in our working. In a real computer memory, the address and its contents are actually much larger than this. Read Operation: Address Content 1111 0001 0101 1011 The READ operation. We will use the memory section above Prepared By: Sir Haydar Suppose we want to read the contents of memory location Under the Supervision of 1111 0001; Miss Hunaisa (Deputy Head the two registers are used as follows: Teacher) the address of location 1111 0001 to be read from is first Cambridge Section written into the MAR (memory address register): 1 1 1 1 0 0 0 1 ‘read signal’ is sent to the computer memory the contents of memory location 1111 0001 are then put into the MDR (memory data register): 0 1 0 1 1 0 1 1 Write Operation: Prepared By: Sir Haydar Address Content Under the Supervision of Miss Hunaisa (Deputy Head Teacher) 1111 0001 0101 1011 Cambridge Section Now let us now consider the WRITE operation. Again, we will use the memory section shown.Suppose this time we want to show how we will write content in the memory location. the data to be stored is first written into the MDR (memory data register) 0 1 0 1 1 0 1 1 this data has to be written into location with address: 1111 0001; so this address is now written into the MAR: 1 1 1 1 0 0 0 1 Finally, a ‘write signal’ is sent to the computer memory and the value 0101 1011 will then be written into the correct memory location. System Bus: (System) buses are used in computers as parallel transmission components; each wire in the bus transmits one bit of data. There are three common buses used in the von Neumann architecture known as: address bus, data bus and control bus. Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Address Bus: Address bus carries addresses throughout the computer system. Between the CPU and memory, the address bus is unidirectional (i.e. bits can travel in one direction only). The width of a bus is very important. The wider the bus, the more memory locations that can be directly addressed at any given time, e.g. a bus of width 16 bits can address 216 (65 536) memory locations. Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Data Bus: The data bus is bidirectional (allowing data to be sent in both directions along the bus). This means data can be carried from CPU to memory (and vice versa) and to and from input/output devices. The wider the bus the larger the word length that can be transported. (A word is a group of bits which can be regarded as a single unit e.g. 16-bit, 32-bit or 64-bit word lengths are the most Prepared By: Sir Haydar common). Larger word lengths can improve the Supervision Under the of computer’s overall performance. Miss Hunaisa (Deputy Head Teacher) Cambridge Section Control Bus The control bus is also bidirectional. It carries signals from the control unit (CU) to all the other computer components. It is usually 8-bits wide. There is no real need for it to be any wider since it only carries control signals. Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Fetch-Decode-Execute Cycle To carry out a set of instructions, the CPU first of all fetches some data and instructions from memory and stores them in suitable registers. Both the address bus and data bus are used in this process. Once this is done, each instruction needs to be decoded before finally being executed. This is all known as the Fetch–Decode– Execute cycle. Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Fetch: Both data and instruction can be stored in MDR. In the Fetch–Decode–Execute cycle, the next instruction is fetched from the memory address currently stored in the MAR and the instruction is stored in the MDR. The contents of the MDR are then copied to the Current Instruction Register (CIR). The PC is then incremented (increased by 1) so that the next instruction can be then be processed. Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Decode The instruction is then decoded so that it can be interpreted in the next part of the cycle. Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Execute: The CPU passes the decoded instruction as a set of control signals to the appropriate components within the computer system. This allows each instruction to be carried out in its logical sequence. Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Hardware Chapter 3 (Part 2) Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Cores, cache and internal clock Factors influencing the performance of CPU: Width of Address and data bus Overclocking cache memories number of cores Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Width of Address and data bus The width of the address bus and data bus (as mentioned earlier) can also affect computer performance and needs to be taken into account. Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Overclocking The clock defines the clock cycle that synchronizes all computer operations. The control bus transmits timing signals ensuring everything is fully synchronized. By increasing clock speed, the processing speed of the computer is also increased (3.5 GHz – which means 3.5 billion clock cycles a second). Although the speed of the computer may have been increased, it does not guarantee overall performance increase. Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Overclocking Overclocking is a factor to consider. The clock speed can be changed by accessing the BIOS (Basic Input/output System) and altering the settings. Higher speeds can lead to some problems for instance: unsynchronized operations frequently crash of computer Become unstable. Prepared By: Sir Haydar overheating Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Cache Memories The use of cache memories can also improve CPU performance. cache memory is located within the CPU itself, which means it has much faster data access. Cache memory stores frequently used instructions and data that need to be accessed faster, which improves CPU performance. When a CPU wishes to read memory, it will first check out the cache and then move on to main memory/RAM if the required data isn’t there. The larger the cache memory size the better the CPU performance Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Cores: The use of a different number of cores can improve computer performance. Core is made up of an ALU, a control unit and the registers. Many computers are dual core (the CPU is made up of two cores) or quad core (the CPU is made up of four cores). The idea of using more cores alleviates the need to continually increase clock speeds. However, doubling the number of cores doesn’t necessarily double the computer’s performance. Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section However, doubling the number of cores doesn’t necessarily double the computer’s performance. For example, with a dual core the CPU communicates with both cores using one channel reducing some of the potential increase in its performance. while, with a quad core the CPU communicates with all four cores using six channels, considerably reducing potential performance. Core 1 Core Core 1 2 Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Core Core Teacher) Core 3 4 Cambridge Section 2 Summarizing these points: » increasing bus width (data and address buses) increases the performance and speed of a computer system. » increasing clock speed will potentially increase the speed of a computer. » a computer’s performance can be changed by altering bus width, clock speed and use of multi-core CPUs » use of cache memories can also speed up a CPU’s performance. Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section 1 a Name three buses used in the von Neumann architecture. b Describe the function of each named bus. c Describe how bus width and clock speed can affect computer performance. 2 Complete the following paragraph by using terms from this chapter: The CPU ………………… data and instructions required for an application and temporarily stores them in the ……………………. until they can be processed. The ………………………… is used to hold the address of the next instruction to be executed. This address is copied to the ………………………… using the …………………………… The contents at this address are stored in the ………………………….. Each instruction is then …………………………. and finally …………………….. by sending out …………………………. using the ……………………………………… Any calculations carried out are done using the ……………………………………. During any calculations, data is Hardware Chapter 3 Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section 3.1.4 Instruction set Opcode The opcode informs the CPU what operation needs to be done Operand The operand is the data which needs to be acted on or it can refer to a register in the memory Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section 3.1.4 Instruction set In a computer system, instructions are a set of operations which are decoded in sequence. Each operation will instruct the ALU and CU. Since the computer needs to understand the operation to be carried out, there is actually a limited number of opcodes that can be used; this is known as the instruction set. All software running on a computer will contain a set of instructions. The Fetch–Decode–Execute cycle is the sequence of steps used by the CPU to process each instruction in sequence. Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section One example of an instruction set is the X86, a common CPU standard used in many modern computers. Although different computer manufacturers will adopt their own internal electronic design, For example, Intel Pentium and AMD Athlon CPUs use almost identical X86 Prepared By: Sir instruction sets even though they are Haydar Under the based on very different electronic Supervision of designs. Miss Hunaisa (Deputy Head Teacher) Cambridge Section (Note of caution: do not confuse instruction sets with programming code; instruction sets are the low-level language instructions that instruct the CPU how to carry out an operation. Program code needs interpreters or compilers to convert the code into the instruction set understood by the computer. Some examples of instruction set operations include: ADD, JMP, LDA, and so on.) Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section 3.1.5 Embedded systems An embedded system is a combination of hardware and software which is designed to carry out a specific set of functions. The hardware is electronic, electrical or electro- mechanical. Three most used embedded systems are discussed below. Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Microcontrollers: This has a CPU in addition to some RAM and ROM and other peripherals all embedded onto one single chip (together they carry out a specific task) Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Microprocessor: Integrated circuit which only has a CPU on the chip (thereis no RAM, ROM or peripherals these need to be added). Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section System on Chips (SoC): This may contain a microcontroller as one of its components (they almost always will include CPU, memory, input/output (I/O) ports and secondary storage on a single microchip). Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Inputs in embedded system Manual Sensor Inputs are analogue or digital in nature. Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section for example, inputs such as oxygen levels or fuel pressure in a car’s engine management system. The output will then carry out the function of the embedded system by sending signals to the components that are being controlled (for example, increase the power to the heating elements in an oven or reduce fuel levels in the engine). Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Embedded systems are either programmable or nonprogrammable. Non-programmable devices need, in general, to be replaced if they require a software upgrade. There are two methods for upgrading programmable embedded systems Connecting the device to a computer and allowing the download of updates to the software (for example, this is used to update the maps on a GPS system used in a vehicle) Automatic updates via a Wi-Fi, satellite or cellular (mobile phone network) link (for example, many modern cars allow updates to engine management systems and other components via satellite link). Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section WORTH TO MENTION Embedded systems can be connected to the internet, it is possible to control them remotely using a smartphone or computer. It is worth mentioning here that a computer is not an example of an embedded system. Computers are multi-functional (that is, they can carry out many different tasks which can be varied by using different software) which means they can’t be classed as embedded systems. Prepared By: Sir Haydar Under the Supervision of Miss Hunaisa (Deputy Head Teacher) Cambridge Section Chapter 3 Hardware Prepared By: Sir Haydar Under the Supervision of Miss Hunaiza (Deputy Head Teacher) Cambridge Section Each digit is made up of 2 dark lines and two light lines. The width representing each digit is the same. The digits on the left have an odd number of dark elements and always begin with a light bar. The digits on the right have an even number of dark elements and always begin with a dark bar. This arrangement allows a barcode to be scanned in any direction. The barcode number is looked up in the stock database (the barcode is known as the key field in the stock item record); this key field uniquely identifies each stock item. when the barcode number is found, the stock item record is looked up the price and other stock item details are sent back to the checkout (or point of sale terminal (POS)) The number of stock items in the record is reduced by 1 each time the barcode is read this new value for number of stock is written back to the stock item record. The number of stock items is compared to the re-order level; if it is less than or equal to this value, more stock items are automatically ordered. Once an order for more stock items is generated, a flag is added to the record to stop re-ordering every time the stock item barcode is read when new stock items arrive, the stock levels are updated in the database. Advantages to the management of using barcodes Much easier and faster to change prices on stock items Much better, more up-to-date sales information/sales trends No need to price every stock item on the shelves (this reduces time and cost to the management) Allows for automatic stock control possible to check customer buying habits more easily by linking barcodes to, for example, customer loyalty cards. Advantages to the customers of using barcodes Faster checkout queues (staff don’t need to remember/look up prices of items) Errors in charging customers is reduced The customer is given an itemized bill Cost savings can be passed on to the customer Better track of ‘sell by dates’ so food should be fresher. Quick response (QR) codes Quick response (QR) codes (QR) code. This is made up of a matrix of filled- in dark squares on a light background. A QR code consists of a block of small squares (light and dark) known as pixels. It can presently hold up to 4296 characters (or up to 7089 digits) and also allows internet addresses to be encoded within the QR code. This compares to the 30 digits that is the maximum for a barcode. However, as more and more data is added, the structure of the QR code becomes more complex. The three large squares at the corners of the code function as a form of alignment, The remaining small corner square is used to ensure the correct size and correct angle of the camera shot when the QR code is read. USES Advertising products Giving automatic access to a website or contact telephone number Storing boarding passes electronically at airports and train stations Advantages of QR codes They can hold much more information as compared to bar code There will be fewer errors, the higher capacity of the QR code allows the use of built-in error-checking systems Normal barcodes contain almost no data redundancy (data which is duplicated) therefore it isn’t possible to guard against badly printed or damaged barcodes. QR codes are easier to read; they don’t need expensive laser or LED (light emitting diode) scanners like barcodes – they can be read by the cameras on smartphones or tablets It is easy to transmit QR codes either as text messages or images It is also possible to encrypt QR codes which gives them greater protection than traditional barcodes. New QR’s Newer QR codes (called frame QR codes) are now being used because of the increased ability to add advertising logos. Frame QR codes come with a ‘canvas area’ where it is possible to include graphics or images inside the code itself. Unlike normal QR codes, software to do this isn’t usually free. Chapter 3 Hardware Prepared By: Sir Haydar Under the Supervision of Miss Hunaiza (Deputy Head Teacher) Cambridge Section Digital cameras Digital cameras have essentially replaced the more traditional camera that used film to capture the images. The film required developing and then printing before the photographer could see the result of their work. These cameras are controlled by an embedded system which can automatically carry out the following tasks: » adjust the shutter speed » focus the image automatically » operate the flash gun automatically » adjust the aperture size » adjust the size of the image » remove ‘red eye’ when the flash gun has been used and so on. Working » the image is captured when light passes through the lens onto a light- sensitive cell; this cell is made up of millions of tiny sensors which are acting as photodiodes (i.e. charge couple devices (CCD) which convert light into electricity) » each of the sensors are often referred to as pixels (picture elements) since they are tiny components that make up the image » the image is converted into tiny electric charges which are then passed through an analogue to digital converter (ADC) to form a digital image array » the ADC converts the electric charges from each pixel into levels of brightness (now in a digital format); for example, an 8-bit ADC gives 28 (256) possible brightness levels per pixel (for example, brightness level 01110011) What are pixels in an image? A pixel is a contraction if the term “Picture Elements. Digital images are made up of small squares, just like a tile mosaic on a wall. Though a digital photograph looks smooth and continuous just like a regular photograph, it's actually composed of millions of tiny squares as shown below. Pixel count Apart from brightness, the sensors also measure color which produces another binary pattern; most cameras use a 24-bit RGB system (each pixel has 8 bits representing each of the 3 primary colors), which means each pixel has a red value (0 to 255), green value (0 to 255) blue value (0 to 255) for example, a shade of orange could be 215 (red), 165 (green) and 40 (blue) giving a binary pattern of 1101 0111 1010 0101 0010 1000 (or D7A528 written in hex) The number of pixels determines the size of the file used to store the photograph The quality of the image depends on the recording device (how good the camera lens is and how good the sensor array is), the number of pixels used (the more pixels used, the better the image), the levels of light and how the image is stored (JPEG, raw file, and so on). Mobile Camera: Mobile phones have caught up with digital cameras as regards number of pixels. But the drawback is often inferior lens quality and limited memory for the storage of photos. But this is fast changing and, at the time of writing, many smartphones now have very sophisticated optics and photography software as standard. Keyboards Used for data entry used as the input devices on computers, tablets, mobile phones and many other electronic items. connected to the computer either by using a USB connection or by wireless connection. In Tablets keyboard is often virtual or a type of touch screen technology. Disadvantages They are slow method of data entry and are also prone to errors Frequent use of these devices can lead to injuries, such as repetitive strain injury (RSI) in the hands and wrists. Advantages keyboards are probably still the easiest way to enter text Ergonomic keyboards can help to overcome RSI problem – these have the keys arranged differently, Ergonomic keyboard Working Each character on a keyboard has an ASCII value. Character pressed is converted into a digital signal There is a membrane or circuit board at the base of the keys If ‘H’ key is pressed and this completes a circuit The CPU in the computer can then determine which key has been pressed Working The CPU refers to an index file to identify which character the key press represents Each character on a keyboard has a corresponding ASCII value

Use Quizgecko on...
Browser
Browser