1.3.1 Logic Gates Logic circuit Draw a logic circuit from the following logic expression Complete the truth table from the above logic expression Draw a logic circuit from the following logic expression Complete the truth table from the above logic expression Logic circuit using problem statements Practice more More problems More problems Logic circuit minimization Some circuits can be constructed with fewer gate to produce the same output We can simplify (minimize) the circuit by applying logical identities. Since the example states that A is true when B is false or the other way around. In terms of logical gates, inequality simply means an XOR gate (exclusive or) A 0 0 1 1 B 1 0 1 0 output 1.3.2 Computer Architecture and the fetch-execute cycle Von Neumann model Von Neumann introduced the idea of the stored program. Previously data and programs were stored in separate memories.von Neumann realized that data and programs are indistinguishable and can therefore use the same memory. Von Neumann architecture uses a single processor. It follows a linear sequence of fetch-decode-execute operations for sequence of instructions which makeup the program. In order to do this a processor has to use some special registers. A register is simply a location that can store extremely limited amount of instruction or data only immediately before or after processing. The registers are outside the immediate access store and consequently allow faster access to the data they store. Processor uses a group of special purpose registers to execute a program Program counter (PC): Program counter is sometimes called sequence control register. It stores the address of the next instruction to be fetched. Memory address register (MAR): When the next instruction is needed, its address is copied from the PC and placed in the memory address register. Memory data registers (MDR): It is sometime called the memory buffer register (MBR) because it acts like a buffer, temporarily storing a data value before passing it on to e.g. CIR. Index register (IR): An index register in a computer's CPU is a processor register used for modifying operand addresses during the run of a program, typically for doing vector/array operations. If the address is an indexed address, add the address to the contents of the index register to form the address of actual data. Current instruction register (CIR): Holds the instruction that is about to be executed. Status register: A status register, flag register, or condition code register is a collection of status flag bits for a processor. The status register is a hardware register which contains information about the state of the processor. Role of arithmetic logic unit (ALU), control unit (CU) and system clock Arithmetic logic unit In digital electronics, an arithmetic logic unit (ALU) is a digital circuit that performs arithmetic and bitwise logical operations on integer binary numbers. It is a fundamental building block of the central processing unit (CPU) found in many computers. An ALU performs basic arithmetic and logic operations. Examples of arithmetic operations are addition, subtraction, multiplication, and division. Examples of logic operations are comparisons of values such as NOT, AND, and OR. Control unit The control unit is a component of a computer's central processing unit (CPU) that directs operation of the processor. It tells the computer's memory, arithmetic/logic unit and input and output devices how to respond to a program's instructions. Control unit: The Control Unit makes decisions and sends the appropriate signal down its lines to other parts of the computer. It controls the timing of operations in the computer and controls the instructions sent to the processor and the peripheral devices. It directs the operation of the other units by providing timing and control signals. All computer resources are managed by the CU (Control Unit).It directs the flow of data between the Central Processing Unit (CPU) and the other devices. The fetch-execute cycle An instruction cycle (sometimes called fetch-and-execute cycle, fetchdecode-execute cycle, or FDX) is the basic operation cycle of a computer. It is the process by which a computer retrieves a program instruction from its memory, determines what actions the instruction requires, and carries out those actions. This cycle is repeated continuously by the central processing unit (CPU), from bootup to when the computer is shut down. Program counter (PC) - an incrementing counter that keeps track of the memory address of the instruction that is to be executed next. Memory address register (MAR) - holds the address of a memory block to be read from or written to. Memory data register (MDR) - a two-way register that holds data fetched from memory (and ready for the CPU to process) or data waiting to be stored in memory. Current Instruction register (IR) - a temporary holding ground for the instruction that has just been fetched from memory. Control unit (CU) - decodes the program instruction in the IR, selecting machine resources such as a data source register and a particular arithmetic operation, and coordinates activation of those resources. Arithmetic logic unit (ALU) - performs mathematical and logical operations. Description in the form of flowchart Register transfer notation 1. [MAR] [PC] 2. PC [PC] + 1 3. MDR [[MAR]] 4. CIR [MDR] 5. DECODE 6. EXECUTE 7. GO TO STEP 1 Step by step description of fetch-execute-cycle 1. Copy the address that is in program counter(pc)into the memory address register (MAR) 2. Increment the PC (ready for next fetch) 3. Load the instruction that is in the memory address given by the MAR into the memory data register (MDR) After increment 4. The MBR loads the Current Instruction Register with the instruction to be executed. 1.3.3 Input Devices 2D scanners Scanners can be used to convert images or text on paper into a digital format that can be used by the computer. A scanner works by shining a beam of light onto the surface of the object that you are scanning. This light is then reflected back onto a sensor that detects the colour of the light. This is then used to build up the digital image. Items that are scanned are usually stored in an image format. However, special software - Optical Character Recognition - can be used to convert text on the paper into text which can be edited with a word processor. However, the text doesn't always get converted very well and you could end up with a lot of mistakes. There are three types of scanner: Flatbed scanners Handheld scanners Specialist scanners The most popular type is the flatbed scanner. This is shown in the picture which has its lid raised to show the glass surface where you place the item to be scanned. This is probably the one that you use at school. They can scan larger images and are more accurate than handheld scanners. Handheld scanners are usually only a few inches wide and are held in the hand whilst they are rolled across the document to be scanned. The images produced are generally not as large or as high quality as those captured with a flatbed scanner. Advantages of scanners Disadvantages of scanners Flatbed scanners are very accurate Images produced by the scanner and can produce reasonably high can take up a lot of memory quality images. space. Any image which is digitised by the scanner can then be included on electronic documents. Images lose some quality in the scanning and digitising process. Images once digitised can be enhanced with a graphics application. The quality of the final image is dependent on the quality of the original image. 3D Scanners A 3D scanner is a device that analyses a real-world object or environment to collect data on its shape and possibly its appearance (e.g. colour). The collected data can then be used to construct digital three-dimensional models. Many different technologies can be used to build these 3D-scanning devices; each technology comes with its own limitations, advantages and costs. Many limitations in the kind of objects that can be digitised are still present, for example, optical technologies encounter many difficulties with shiny, mirroring or transparent objects Collected 3D data is useful for a wide variety of applications. These devices are used extensively by the entertainment industry in the production of movies and video games. Other common applications of this technology include industrial design The purpose of a 3D scanner is usually to create a point cloud of geometric samples on the surface of the subject. These points can then be used to extrapolate the shape of the subject (a process called reconstruction). If colour information is collected at each point, then the colours on the surface of the subject can also be determined. Bar code reader Barcodes are used to represent information about products. A barcode is normally a pattern of thick and thin dark and light lines. A form of scanner called a barcode reader is used to read them. Some are handheld and some are built into the EPOS terminal. Like a flatbed scanner, it consists of a light source, a lens and a light sensor translating optical impulses into electrical ones. The different thicknesses of lines are converted by computer into a number. They are used in all kinds of shops, wherever the details of products represented b code numbers need to be input. In libraries they are used to input the book number and library card number. They are faster than typing the number in using a keypad and more accurate method of data entry compared with typing the number in. Digital cameras A digital camera (or digicam) is a camera that encodes digital images and videos digitally and stores them for later reproduction. Most cameras sold today are digital, and digital cameras are incorporated into many devices ranging from PDAs and mobile phones (called camera phones) to vehicles. Digital and film cameras share an optical system, typically using a lens with a variable diaphragm to focus light onto an image pickup device. The diaphragm and shutter admit the correct amount of light to the imager, just as with film but the image pickup device is electronic rather than chemical. However, unlike film cameras, digital cameras can display images on a screen immediately after being recorded, and store and delete images from memory. Many digital cameras can also record moving videos with sound. Some digital cameras can crop and stitch pictures and performs other elementary image editing. Keyboard The most common input device it is used for inputting text,numbers,punctuation marks, symbols and instructions using a number of software applications. By pressing down a key completes an electrical circuit. This circuit then transmits a binary signal (commonly using ASCII) to the computer to represent the key pressed. Ergonomic or ergonometric keyboards are shaped so that the user is less likely to suffer from RSI (repetitive strain injury). Overlay or concept keyboards consist of an A4-sized tray that can have an overlay sheet in it. It is used by people who may have disabilities as it is easier to press a large symbol than to press the key on the keyboard. Laser mouse An optical computer mouse uses a light source, typically a light-emitting diode, and a light detector, such as an array of photodiodes or an image sensor, to detect movement relative to a surface. It is an alternative to the mechanical mouse, which uses moving parts to perform the same function. When a mouse is connected with the computer, a red LED starts glowing. This light is focused on the surface beneath the mouse by a special type of lens (HDNS2100). The reflected light falls back to the camera integrated in Optical Mouse Sensor. The camera takes images of the surface with a frequency in the range of 1500 to 6000 images per second to calculate the position of mouse. These images are processed by Digital Signal Processor (DSP) and resultant co-ordinates are sent to the PC. The driver of the mouse installed in the computer receives the coordinates and makes the cursor move on the screen accordingly. Touch screens A touch screen is the only device which works as both an input and an output device. You view the options available to you on the screen (output) and you then use your finger to touch the option that you have chosen (input). Touch screens work particularly well with a menu driven interface. For example, a cashpoint (ATM) at a bank would first of all ask which service you want. You touch the option 'withdraw cash' on the screen. You are then presented with another choice, 'how much cash do you want to withdraw?’ Once you have chosen how much, you then get other options such as 'do you want a receipt?’ Another major use of touch screens are on smart phones and modern tablet computers. Each 'app' is accessed by an icon on the touch screen. Touch screens are easy to use and are often found in public places such as cashpoints at banks, ticket collection terminals at theatres or airports, information centres at museums. Touch screens are not commonly used to input large amounts of data because they are not very accurate and they would be tiring on the hands to use for long periods of time. Capacitive Infra-red Made up of many layers of glass that act like a capacitor, creating electric fields between the glass plated in layers The electric current changes when the top glass layer is touched which is determined by a microprocessor. Heat sensitive It uses glass as screen material which needs a warm object e.g finger to carry out input operation Advantages Screen visibility is good even in strong sunlight Permits multi-touch capability. Screen is very durable It is a medium cost technology. Advantages Allow multi-touch capability The optical system allows bare finger, gloved or stylus for input. Both have good screen durability, it takes a major impact to break the glass Both have fairly good visibility in strong sunlight. Disadvantages Relatively expensive technology Heat-sensitive only allow bare fingers to be used for input. Disadvantages It allows only bare fingers as input but latest screens permit a special stylus to be used resistive Optical It uses an array of sensors in the form of grid The point of contact is based on which coordinated is touched. Consists of upper layer of polyester and bottom layer of glass. When top layer is touched, the top and bottom layer complete a circuit. Signals are sent out and interpreted by a microprocessor; the calculations determine the coordinates of where the screen was touched. Advantages Relatively inexpensive technology Can used bare finger, gloved finger or a stylus to carry out an input operation Disadvantages Screen visibility is poor in strong sunlight. Doesn’t permit multitouch capability. The screen durability is only fair and vulnerable t scratches and wears out through time. Microphones Microphones are used to input sound, which can then be stored and manipulated. The sound input to the microphone is converted into an analogue electrical signal, which has to be converted in turn into a digital signal so that the computer can process it. This is usually done by the computer’s sound card, which acts as an analogue to digital converter. Sensor: A sensor is a device that detects events or changes in quantities and provides a corresponding output, generally as an electrical or optical signal. They can produce a stream of input data automatically without any human intervention. Usually this is an analogue signal so it needs to be converted into digital data for the computer to process. This is done using by an Analogue-to-Digital Converter (ADC). Sensors are used extensively in monitoring / measuring / data logging systems, and also in computer control systems. Following is the list of commonly used sensors: Temperature Magnetic Field Gas Pressure Moisture Humidity Ph/Acidity/Alkalinity Motion/ Infra-Red Advantages of using sensors to collect data are: 1. They can collect data far more frequently than a person. 2. They are more reliable than a person, who may forget to take readings. 3. They are more accurate than a person who may misread the signal. 4. They can collect data from places where it is not possible for a person to go such as inside a chemical or nuclear reaction vessel. The disadvantage of using sensors is that they may need a power supply to work and may need regular calibration to check their accuracy. Temperature Sensor: A temperature sensor produces a signal that depends on the temperature of its surroundings. The computer process the digitize signal to display a measurement or to control an appliance. We can use temperature sensor in many appliance such: Automatic washing machine Digital thermometer Controlling heating system in buildings, including greenhouses and chemical reaction vessels. Pressure sensor: A pressure sensor produces a signal that depends on the pressure to which it is exposed. Pressure sensor can be used in many appliances such as automatic blood pressure monitor. Pressure sensor can also control the pressure of gases or liquids in chemical reaction vessel. Magnetic Field: The Magnetic Field Sensor can be used to study the field around permanent magnets, coils, and electrical devices. This sensor uses a Hall effect transducer, and measures a vector component of the magnetic field near the sensor tip. It has two ranges, allowing for measurement of relatively strong magnetic fields around permanent magnets and electromagnets, as well as measurement of weak fields such as the Earth’s magnetic field. The articulated sensor tip allows you to measure both transverse and longitudinal magnetic fields. Gas: A gas sensor produces a signal depending on the concentration of a particular gas or vapor. We can use gas sensor for an inflammable gas to monitor the atmosphere and sound an alarm if there is a leakage. We can use gas sensor in other applications such as: Breathalyzer, which measure the concentration of alcohol vapour in a sample of breath and estimate the concentration of alcohol in blood. Process control in chemical industry. Environment monitoring of air pollution Moisture/ Humidity sensor A moisture sensor produces a signal that depends on the concentration of water vapors in the atmosphere. A moisture sensor can control an irrigation system more efficiently only allow water when soil is dry. We can use moisture sensor in many other application including: Controlling a heating system and air conditioning system. Maintaining sufficient humidity in the air in a greenhouse. Measuring humidity for meteorological record and forecasting in a weather station. PH/acidity/alkalinity sensor: .1 Input, output and storage devices PH Sensor measures the pH of aqueous solutions in industrial and municipal process applications. It is designed to perform in the harshest of environments, including applications that poison conventional pH sensors. Typical activities using our pH sensor include: Acid-base titrations Studies of household acids and bases Monitoring pH change during chemical reactions or in an aquarium as a result of photosynthesis Investigations of acid rain and buffering Analysis of water quality in streams and lakes Infrared sensor: An infra (IR) sensor produces a signal that depends on the level of invisible IR radiation falling on it. All objects (unless they are extremely cold) emit significant IR radiation. Security camera equips with lens and grid of IR sensors uses this IR radiation to form a detector for a person. Sensor Measures Where Used Heat Temperature Living room for central heating system Humidity Water vapour in the air Swimming pool, greenhouse Infra-red Infra-red radiation e.g. body heat Security alarm systems Light Light levels External security lights PH Acid/alkali levels e.g. pH of soil Environmental experiments, river pollution Pressure Pressure Burglar alarm systems, automatic doors Smoke Smoke in the atmosphere Offices Sound Levels of sound Security alarm systems Tilt Angle of tilt Windows in security alarm system Touch Detects if one object bumps into another Computer controlled robots 1.3.4 Output devices Printer A printer is a peripheral which makes a persistent human-readable representation of graphics or text on paper or similar physical media. Impact printers rely on a forcible impact to transfer ink to the media. The impact printer uses a print head that either hits the surface of the ink ribbon, pressing the ink ribbon against the paper (similar to the action of a typewriter), or hits the back of the paper, pressing the paper against the ink ribbon (the IBM 1403 for example) Non-impact is a type of printer that does not operate by striking a head against a ribbon. Examples of nonimpact printers include laser and ink-jet printers. Ink-jet printer Inkjet printing is a type of computer printing that recreates a digital image by propelling droplets of ink onto paper, plastic, or other substrates. It works by spraying ionized ink at a sheet of paper. Magnetized plates in the ink's path direct the ink onto the paper in the desired shapes. Ink-jet printers are capable of producing high quality print. Laser printer This type of printer produces very high quality hard copy. It consists of drum that is electrically charged. A laser is used to change the charge on the drum for each dot of the output to be produced. Electrically charged toner is then attracted to the oppositely charged dots. The paper presses against the toner coated drum and is output with the pattern of dots required which is then heated in order to permanently fuse the text/imagery. The page cannot be printed until the whole document has been stored in a large buffer. Speakers It is a device which produces sound as output. The digital data from the computer is converted into analogue signals by a digital to analogue converter and are then amplified and output using the speakers. At the front of a loudspeaker, there is a fabric, plastic, paper, or lightweight metal cone. The inner part is fixed to an iron coil (sometimes called the voice coil) that sits just in front of a permanent magnet (sometimes called the field magnet). When electric current is passed through coil; it becomes a temporary magnet (electromagnet). As the electricity flows back and forth in the cables, the electromagnet either attracts or repels the permanent magnet. This moves the coil back and forward, pulling and pushing the loudspeaker cone which produces sound. 2D, 3D cutters A 3d laser cutter can recognize all sides of a substance to make more complex shapes. A 3d laser cutter can also work with a cube instead of a flat piece of a material. A 2d and 3d cutter is a high powered laser that cuts material such as thin metals or woods, used mostly for industrial purposes. They make precise and clean cuts, it is also is very fast which makes it efficient. It is first designed through a computer and then sent through a laser cutter to give you the design. Headphones Actuators Actuators are used to convert computer signals into movement.e.g motors. In industries motors are used to move robot arms. In computers they are used to cause moving parts t o work in disk drives. An actuator can also be connected from the computer to heater and set to switch heater either on or off. LCD Short for liquid crystal display, a type of display used in digital watches and many portable computers. LCD displays utilize two sheets of polarizing material with a liquid crystal solution between them. An electric current passed through the liquid causes the crystals to align so that light cannot pass through them. Each crystal, therefore, is like a shutter, either allowing light to pass through or blocking the light. The LCD screen is more energy efficient and can be disposed of more safely than a CRT. Its low electrical power consumption enables it to be used in batterypowered electronic equipment. LED Short for light emitting diode. A flat-screen device in which an array of lightemitting diodes can be selectively activated by processor to display numerical and alphabetical information ,used esp in pocket calculators ,digital timepieces, measuring instruments , and in some microcomputers. DLP Projectors, or digital light processing, uses tiny mirrors to reflect light toward the screen (an "on" pixel) or away (an "off" pixel). Most models use a color wheel, literally a spinning wheel with color filters to create sequential color. Some high-end models use three DLP chips; one each for red, green, and blue. DLP projectors range in price from a few hundred dollars to tens of thousands, and more. Most projectors in movie theaters use DLP. LCD Projectors, which stands for liquid crystal display, is very similar to the technology found in most TVs. LCD projectors use three liquid crystal panels, each tasked with creating an image using just one of the primary colors (red, green, and blue). All three are projected on the screen at once, so you see a full color image. LED vs. DLP projectors DLP is significantly more expensive than LCD, but requires less ongoing maintenance. LCD projectors are portable and lightweight. DLP quality is superior to LCD (although LCD is sufficient for most usage). Film, photography, highly detailed graphics and images, etc., will all appear crisper and brighter with DLP technology as compared to LCD. 1.3.5 Memory, storage devices and media Primary memory is computer memory that is accessed directly by the CPU. This includes several types of memory, such as the processor cache and system ROM. However, in most cases, primary memory refers to system RAM. RAM, or random access memory, consists of one or more memory modules that temporarily store data while a computer is running. RAM is volatile memory, meaning it is erased when the power is turned off. Therefore, each time you start up your computer, the operating system must be loaded from secondary memory (such as a hard drive) into the primary memory, or RAM. Similarly, whenever you launch an application on your computer, it is loaded into RAM. The operating system and applications are loaded into primary memory, since RAM can be accessed much faster than storage devices. In fact, the data can be transferred between CPU and RAM more than a hundred times faster than between the CPU and the hard drive. By loading data into RAM, programs can run significantly faster and are much more responsive than if than constantly accessed data from secondary memory. NOTE: Primary memory may be called "primary storage" as well. However, this term is somewhat more ambiguous since, depending on the context, primary storage may also refer to internal storage devices, such as internal hard drives. DVD RAM DVD RAM is a recent addition to the optical media group. Unlike other CD and DVD formats, DVD RAMs have several discrete concentric tracks rather than a single spiral track. This gives them the advantage that writing and reading can occur at the same time. This makes it possible to watch an already recorded television program at the same time as different program is being recorded.DVD RAMs can written to many times.DVD RAMs have a long life estimated to be 30 years and re- write operation can be carried out over 100,000 times which is 100 times more than RW formats. Secondary memory refers to storage devices, such as hard drives and solid state drives. Unlike primary memory; secondary memory is not accessed directly by the CPU. Instead, data accessed from secondary memory is first loaded into RAM and is then sent to the processor. The RAM plays an important intermediate role, since it provides much faster data access speeds than secondary memory. By loading software programs and files into primary memory, computers can process data much more quickly. While secondary memory is much slower than primary memory, it typically offers far greater storage capacity. For example, a computer may have a one terabyte hard drive, but only 16 gigabytes of RAM. Secondary memory is nonvolatile, meaning it retains its data with or without electrical power. RAM, on the other hand, is erased when a computer is shut down or restarted. Therefore, secondary memory is used to store "permanent data," such as the operating system, applications, and user files. Hard disk A hard disk is really a set of stacked "disks," each of which, like phonograph records, has data recorded electromagnetically in concentric circles or "tracks" on the disk. A "head” records (writes) or reads the information on the tracks. Two heads, one on each side of a disk, read or write the data as the disk spins. Each read or write operation requires that data be located, which is an operation called a "seek." (Data already in a disk cache, however, will be located more quickly.) A hard disk/drive unit comes with a set rotation speed varying from 4500 to 7200 rpm. Disk access time is measured in milliseconds. The physical location can be identified with cylinder, track, and sector locations. Solid state devices (SSDs) Solid-state drives actually aren't hard drives in the traditional sense of the term, as there are no moving parts involved. A traditional hard disk drive (HDD) consists of a spinning disk with a read/write head on a mechanical arm. An SSD, on the other hand, has an array of semiconductor memory organized as a disk drive, using integrated circuits (ICs) rather than magnetic or optical storage media. Off-line storage Offline storage is any storage that is not currently online, live or connected to the computer. The data stored in offline storage remains permanently in the storage device even if it’s disconnected or unplugged from the computer after the data has been stored. Offline storage is generally portable in nature and can be used on different computer systems. Common examples of offline storage include floppy disks, compact disks and USB sticks. Solid state memory Solid state systems control the movements of electrons within the microchip. The 1s and 0s are stored in millions of miniature transistors within the microchip. If a transistor conducts a current this is equivalent to a 1 otherwise 0.they consequently have no moving parts, consume much less power and are extremely robust. Memory sticks/pen drives It uses solid state technology to store several GBytes of data. It is usually connected to a computer through the USB port and power to operate them is drawn from the host computer. They are small and very portable. Memory sticks and pen drives are used for transporting files between computers or as a backup store. They are used a security device, a dongle, to prevent software piracy Flash memory cards These are a form of electrically erasable programmable read only memory (EEPROM) and are another example of solid state memory. They are used to store photos on digital cameras. Mobile phones use them as memory cards. They are also used in MP3 players to store music files. They are very compact and robust. Compact Disks (CDs) The data is stored as a series of pits (equivalent to binary 1) and lands (equivalent to binary 0) in metallic optical layer. The pits are formed by a laser beam etching the surface at the manufacturing stage. Only a single track exits which spirals out from the centre of the disk. The pits and lands are read by a low-powered laser beam which follows the data stream and reads from the centre outwards in a spiral. The light reflects differently off a pit than it does off a land and this interpreted a s1s and 0s. DVDs DVDs can hold up to ten times the amount of data that a CD can store.DVD writers use a shorter wavelength of laser light than CD writers do, so the pit on the disk surface is a lot smaller and more can be stored in the same space. CDs and DVDs are cheaper and robust than hard disks but data transfer rates and access times for both are slower than hard disks. Blu-ray These have largest capacity of all optical disks up to 100 GB or more. It uses a shorter wavelength for its laser beam, using light that is close to the blue/violet spectra rather than the red light used by other optical devices. They are mostly used for storing films (movies)