Download presentation
Presentation is loading. Please wait.
Published by은비 창 Modified over 5 years ago
1
Computer Systems Instructional Slides / Content Computer Components
2
Computer Architecture Electronics, Gates and Circuits
Layers of a Computing System End-user Application Software System Software Computer Architecture Different levels of abstraction – each layers hides the complexities of the others Can focus on each layer separately without having to worry about the detaul of the adjacent/other layers Electronics, Gates and Circuits Data Representation
3
Data Representation A Bit (Binary digIT) has two possible values – 0 and 1 Used to represent one of two discrete states. 0 (OFF) or 1 (ON) 0 (False) or 1 (True) Two bits can represent four different things. Three bits can represent eight different things. How many things can n bits represent? Computers are finite! How do we represent an infinite world? We represent enough of the world to satisfy our computational needs (and our senses of sight and sound) Each time we add a bit we double the number of things we can represent. IMPORTANT Ask: What is the difference between analogue and digital data? Ask: Why do we use binary to represent digital data? Ask: Why don’t we try to represent analog data? Ask: How are numbers represented in binary? (see Ch 3, CS Illuminated ) Negative values? (2’s complements, overflow, subtraction) Real Numbers? Nice - Bits are used to represent numbers, text characters, images, sound, etc.
4
ASCII Character Set Extended ASCII uses 8 bits – 256 chars – still not enough for international use Unicode: One Unicode mapping uses 16 bits per character How many characters can this mapping represent? The first 256 characters correspond exactly to the extended ASCII character set
5
ASCII Character Set Extended ASCII uses 8 bits – 256 chars – still not enough for international use Unicode: One Unicode mapping uses 16 bits per character How many characters can this mapping represent? The first 256 characters correspond exactly to the extended ASCII character set
6
Binary (bit) Addition Only four possible combinations of input:
Truth Table Logic Gates (Circuit) Boolean Expressions Four ways to represent the addition of bit addition (different levels of abstraction) SUM: From the truth table it is clear that the SUM is only produced when A is at 1 and B is 0 or when A is 0 and B is 1. The Boolean expression for the SUM output from the above truth table can be written as A AND NOT B OR NOT A AND B This is the same as A XOR B A CARRY is produced only when both A and B are at a logical 1. The Boolean expression for the CARRY output from the above truth table can be written as CARRY = A AND B What if there were three inputs? (Two bits and a carry) 𝑆𝑈𝑀= 𝐴. 𝐵 + 𝐴 .𝐵 𝐶𝐴𝑅𝑅𝑌= 𝐴.𝐵
7
Logic Gates Bits can be used to represent electrical signals:
0 (0V) or 1 (5V) A gate is a device that performs a logical operation on electrical signals These logical operations were defined by the mathematician George Boole ( ) The most common logic (Boolean) operations are: NOT AND OR XOR NAND NOR Could also say that electrical signals are used to represent bits A Gate is a device that computes a Boolean operation A Gate is a device that produces the output of a Boolean operation when given the operation’s input values. Gates can be: Gears, Relays, Optic devices, Electronic circuits (microchips) Gates are the building blocks of digital circuits Integrated Circuits (microchips) are used to store and process bits. Remember bits represent information to – this is how electricity is used to proess information
8
Logic Gates Symbols Each gate has its own logic symbol which allows circuits to be represented by a logic diagram AND NAND OR NOR These symbols are specified as standards by ANSI/IEEE ( ) NOT Exclusive OR (XOR) Logic gates have one or more inputs and a single output
9
Logic Gates The behaviour of gates (and circuits) are commonly represented in any of the following ways: Boolean Expressions Uses Boolean algebra, a mathematical notation for expressing two-valued logic Logic Diagrams A graphical representation of a circuit; each gate has its own symbol Truth Tables A table showing all possible input values and the associated output values A Gate is a device that computes a Boolean operation A Gate is a device that produces the output of a Boolean operation when given the operation’s input values. Truth tables are a useful tool for working out how different propositions logically relate to each other. The next slides show the truth table and Boolean notation for each gate
10
The AND operation The operation of each gate can be described by using truth tables or using Boolean notation An AND gate accepts two input signals If both are 1, the output is 1; otherwise, the output is 0 In order for the output to be 1 both inputs must be 1
11
The OR operation If either input is 1 the output is 1 (If both are 0, the output is 0; otherwise, the output is 1) In order for the output to be 1 either input must be 1.
12
The NOT operation Inverts a single input. Also called an inverter.
13
NAND NOR A NAND B = NOT (A AND B) A NOR B = NOT (A OR B)
NAND Inverts AND NOR Inverts OR Both are universal gates – any other gate can be constructed using either of these.
14
The XOR (eXclusive OR) operation
A AND NOT B OR NOT A AND B = A XOR B In order for the output to be 1 either (but not both) inputs must be 1. (A AND NOT B) OR (NOT A AND B) = A XOR B
15
Boolean Algebra Boolean Constants: these are ‘0’ (false) and ‘1’ (true) Boolean Variables: variables that can only take the vales ‘0’ or ‘1’ Boolean Functions: such as NOT, AND and OR (in that order) Boolean Theorems: a set of identities and laws Boolean Constants these are ‘0’ (false) and ‘1’ (true) Boolean Variables variables that can only take the vales ‘0’ or ‘1’ Boolean Functions each of the logic functions (such as AND, OR and NOT) are represented by symbols as described above Boolean Theorems a set of identities and laws – see text for details Operator precedence – Brackets, NOT, AND, OR
16
Complete the truth table for a Boolean expression
17
Complete the truth table for a Boolean expression
𝐴.𝐵 Exercise Try any of … A AND NOT B OR A NOT (A AND B) A.0 A.1 A.A A. A A+A A+ A A+0 A+1
18
Using truth tables to verify identities
Let’s say we wanted to investigate whether the identity holds Circuit equivalence: two different circuits when given the same inputs produce identical output Remember NOT (A AND B) = A NAND B Is NOT A OR NOT B = NOT (A OR B) ? NOT (A OR B) = A NOR B Is NOT A AND NOT B = NOT (A AND B) ?
19
Using truth tables to verify identities
Investigate whether the identity holds A+ A.B =𝐴 Absorption Law This is an example of how Boolean expressions/identities/laws can be verified using truth tables
20
Using truth tables to verify identities
Here there are 3 inputs => 8 possible combinations need to be considerd Circuit equivalence: two different circuits when given the same inputs produce identical output This truth table has real world relevance : College=P AND (A OR C) College=(P AND A) OR (P AND C) So P AND (A OR C) = (P AND A) OR (P AND C) Exercise – do for A+ B.C = A+B . A+C A. B+C = A.B + A.C Distribution :
21
Using truth tables to verify identities
Distribution : A+ B.C = A+B . A+C
22
Using truth tables to verify identities - exercise
De Morgan's laws are used to simplify Boolean equations so that you can build equations only involving one sort of gate. Verify De Morgan's laws using truth tables 𝐴 + 𝐵 = 𝐴.𝐵 ≡ 𝐴 . 𝐵 = 𝐴+𝐵 Exercise De Morgan's laws are used to simplify Boolean equations so that you can build equations only involving one sort of gate, leading to cheaper hardware. (circuit equivalence) Try, A or not A and B = A or B ≡
23
Using truth tables to verify identities - SOLUTIONS
𝐴.𝐵 = 𝐴 + 𝐵 𝐴+𝐵 = 𝐴 . 𝐵 De Morgan's laws are used to simplify Boolean equations so that you can build equations only involving one sort of gate, leading to cheaper hardware.
24
Create a Boolean Expression from a logic diagram
Work progressively from the inputs to the output adding logic expressions to the output of each gate in turn A. B+C B+C
25
Create a Boolean Expression from a logic diagram
Work progressively from the inputs to the output adding logic expressions to the output of each gate in turn A.B A.B + B.C A.C
26
Create a Boolean Expression from a logic diagram
Exercises Y = NOT A OR NOT B X = NOT A AND NOT B OR A AND B Z = NOT A OR B AND C Y = A AND B AND NOT C
27
Connect Logic Gates (to create circuits)
Logic gates may be combined by using the output of one gate as the input to another. Circuits - gates combined to perform more complicated tasks Circuits in which the output is determined solely by the current inputs are termed combinational logic circuits This is the NOR gate (again)
28
A AND NOT B OR NOT A AND B = A XOR B
Connect Logic Gates (to create circuits) Circuits in which the output is determined solely by the current inputs are termed combinational logic circuits. Circuits - gates combined to perform more complicated tasks Circuits in which the output is determined solely by the current inputs are termed combinational logic circuits This is the XOR gate (again) – very useful when it comes to adders A AND NOT B OR NOT A AND B = A XOR B
29
Half-adder An adder is a digital circuit that performs addition of numbers. A half adder adds two binary digits and produces two outputs – the sum and the carry Half Adder SUM CARRY B A A full adder adds the carry in bit to two binary digits and produces two outputs – the sum and carry out Block diagram
30
Half-adder Only four possible combinations of input: 𝑆𝑈𝑀= 𝐴. 𝐵 + 𝐴 .𝐵
We can construct a half-adder by looking at each output in turn: SUM: From the truth table it is clear that the SUM is only produced when A is at 1 and B is 0 or when A is 0 and B is 1. The Boolean expression for the SUM output from the above truth table can be written as A AND NOT B OR NOT A AND B This is the same as A XOR B A CARRY is produced only when both A and B are at a logical 1. The Boolean expression for the CARRY output from the above truth table can be written as CARRY = A AND B 𝐶𝐴𝑅𝑅𝑌= 𝐴.𝐵
31
Half-adder 𝑆𝑈𝑀= 𝐴. 𝐵 + 𝐴 .𝐵 𝐶𝐴𝑅𝑅𝑌= 𝐴.𝐵 𝐴. 𝐵 𝐵 𝐴 . 𝐴 .𝐵 A B SUM A CARRY
32
Half-adder A B SUM CARRY
33
Half-adder (refined) The circuit for SUM can be simplified as follows:
𝑆𝑈𝑀= 𝐴. 𝐵 + 𝐴 .𝐵 = 𝐴 𝐵 (i.e. A XOR B) The half-adder can now be realised with fewer gates as shown CARRY B A SUM SUM: From the truth table it is clear that the SUM is only produced when A is at 1 and B is 0 or when A is 0 and B is 1. The Boolean expression for the SUM output from the above truth table can be written as A AND NOT B OR NOT A AND B This is the same as A XOR B
34
Full-adder A full adder adds the carry in bit to two binary digits and produces two outputs – the sum and carry out. A SUM Full Adder B Carry In CARRY (out)
35
Full-adder A full adder adds the carry in bit to two binary digits and produces two outputs – the sum and carry out 𝑆𝑈𝑀= 𝐴 . 𝐵 .𝐶+ 𝐴 .𝐵. 𝐶 +𝐴. 𝐵 . 𝐶 +𝐴.𝐵.𝐶 𝐶𝐴𝑅𝑅𝑌= 𝐴 .𝐵.𝐶+𝐴. 𝐵 .𝐶+𝐴.𝐵. 𝐶 +𝐴.𝐵.𝐶 𝑆𝑈𝑀=𝐴 𝐵 𝐶 𝐶𝐴𝑅𝑅𝑌= 𝐶(𝐴 𝐵)+𝐴.𝐵
36
Full-adder (circuit for SUM)
𝑆𝑈𝑀= 𝐴 . 𝐵 .𝐶+ 𝐴 .𝐵. 𝐶 +𝐴. 𝐵 . 𝐶 +𝐴.𝐵.𝐶 𝑆𝑈𝑀= 𝐴 ( 𝐵 .𝐶+𝐵. 𝐶 )+𝐴( 𝐵 . 𝐶 +𝐵.𝐶 𝐵 . 𝐶 +𝐵.𝐶= 𝐵 𝐶 Taking, 𝐵 .𝐶+𝐵. 𝐶 =𝐵 𝐶 𝑋=𝐵 𝐶 𝑆𝑈𝑀= 𝐴 .𝑋+𝐴. 𝑋 B A C SUM 𝑆𝑈𝑀=𝐴 𝑋 𝑆𝑈𝑀=𝐴 𝐵 𝐶
37
Full-adder (circuit for CARRY)
𝐶𝐴𝑅𝑅𝑌= 𝐴 .𝐵.𝐶+𝐴. 𝐵 .𝐶+𝐴.𝐵. 𝐶 +𝐴.𝐵.𝐶 𝐶𝐴𝑅𝑅𝑌= 𝐶( 𝐴 .𝐵+𝐴. 𝐵 )+𝐴.𝐵(𝐶+ 𝐶 𝐶𝐴𝑅𝑅𝑌= 𝐶(𝐴 𝐵)+𝐴.𝐵 CARRY B A C
38
Full-adder 𝑆𝑈𝑀=𝐴 𝐵 𝐶 𝐶𝐴𝑅𝑅𝑌= 𝐶.(𝐴 𝐵)+𝐴.𝐵 A B SUM C CARRY A XOR B
A XOR B XOR C C AND (A XOR B) CARRY C AND (A XOR B) OR (A AND B) A AND B
39
Computer Architecture
Instructional Slides / Content Computer Components
40
The stored program concept
Early computers (e.g. ENIAC) were fixed-program machines. Programs were wired into the machines. (Data and programs were treated separately.) In 1945 John von Neumann and Alan Turing independently proposed what has become known as the stored program computer. A computer architecture that allows programs and data to reside together in memory. The contents of memory is interpreted as an instruction when the next instruction pointer references it and as data when an instruction references it. Stored programs are not part of physical machine. Program instructions are directly accessible by the processor. Instructions are fetched and executed one at a time. Common misconception - we tend to think of data being stored in a computer, BUT in reality, both data and instructions are stored there Programs being treated as the same as data has some disadvantages too – can cause bottlenecks (a virus is a program treated as data when we download it) The von Neumann architecture has become synonomous with the concept of the stored-program computer (proposed independently by Alan Turing and John von Neumann in 1945). The earliest computing machines had fixed programs. For example, a desk calculator (in principle) is a fixed program computer. It can do basic mathematics, but it cannot be used as a word processor or a gaming console. Changing the program of a fixed-program machine requires re-wiring, re-structuring, or re-designing the machine. The earliest computers were not so much "programmed" as they were "designed". "Reprogramming", when it was possible at all, was a laborious process, starting with flowcharts and paper notes, followed by detailed engineering designs, and then the often-arduous process of physically re-wiring and re-building the machine. It could take three weeks to set up a program on ENIAC (a computer of 1940s) and get it working. A stored-program digital computer is one that keeps its programmed instructions, as well as its data, in read-write, random-access memory (RAM). So John Von Neumann introduced the idea of the stored program. Previously data and programs were stored in separate memories. Von Neumann realised that data and programs are indistinguishable and can, therefore, use the same memory. On a large scale, the ability to treat instructions as data is what makes assemblers, compilers and other automated programming tools possible. One can "write programs which write programs". This led to the introduction of compilers which accepted high level language source code as input and produced binary code as output.
41
Von Neumann Architecture
Primary Memory Central Processing Unit (CPU) Secondary Storage Devices Control Unit (CU) Arithmetic Logic Unit (ALU) Input Devices Output Devices 2.11 describe the different components within a computer and the function of those components The phrase Von Neumann architecture derives from a paper written by computer scientist John von Neumann in1945. This describes a design architecture for an electronic digital computer with subdivisions of a central arithmetic part, a central control part, a memory to store both data and instructions, external storage, and input and output mechanisms. The meaning of the phrase has evolved to mean a stored-program computer. Maybe have a separate slide for each of the following: Primary memory is also known as Main Memory/Working Memory – it consists of RAM and ROM Examples of input devices include: keyboard, pointing devices, microphone, stylus, scanners, game console controller/joysticks, sensors Examples of output devices include: monitor/screen, printers, speakers, motors etc. Secondary Storage Technologies: magnetic, optical, solid state Examples of secondary storage: Tape Drives, Hard Disk Drives (internal and external), SSD, DVD/CD-RW/CR-R The components are connected to one another by a collection of wires called a bus
42
Von Neumann Architecture
There are four major components in a computer connected together by buses: Primary Memory: The temporary store for instructions and data. Central Processing Unit (CPU): Controls the operation of the computer. The Control Unit (responsible for the fetch-execute cycle) The Arithmetic Logic Unit (ALU) (carries out arithmetic and logical operations) Input/Output (I/O) Units: Handle communication with the outside world. Secondary Storage Units: Long term storage of data. Data is moved from secondary storage to primary memory for CPU execution. The CPU interacts with memory in 3 ways: By fetching instructions By loading a memory word into a processor register (the LOAD operation) By storing the contents of a processor register into a memory word (the STORE operation) An input unit is a device through which data and programs from the outside world are entered into the computer e.g. keyboard, pointing devices, microphone, stylus, scanners, game console controller/joysticks, sensors An output unit is a device through which results stored in the computer memory are made available to the outside world e.g. monitor/screen/VDU, printers, speakers, motors etc. I/O units form the most divers part of a computer – most i/o devices are interrupt driven (i.e. device sends a signal to the CPU when it wants attention) Because most of main memory is volatile and limited, it is essential that there be other types of storage devices where programs and data can be stored when they are no longer being processed
43
Memory Memory is a collection of cells, each with a unique physical address A cell is the smallest addressable unit of memory Addresses are of fixed size – the address length Cells are of fixed size – the word length (word size) Random Access Memory (RAM) A cell with a low address is just as accessible as one with a high address. Contents are volatile. Data can be written to as well as read from RAM A 1-bit machine will have 2^1=2 cells/addresses A 1-bit machine will have 2^2=4 cells/addresses A 3-bit machine will have 2^3=8 cells/addresses An 8-bit machine will have 2^8=256 cells/addresses A 16-bit machine will have 2^16=65536 cells/addresses An 32-bit machine will have 2^32 etc. What is the relationship (if any) between address length and word size? What does the phrase 32-bit machine mean? What does 8GB RAM mean? Is there a relationship between address length/word size and size of RAM? Read Only Memory (ROM) Non-volatile memory used to store firmware (specialised programs used to carry out specific tasks typically when a computer is switched on.)
44
The von Neumann Architecture of a Computer
Central Processing Unit (CPU) Control Unit (CU) Arithmetic Logic Unit (ALU) PC IR ACC1 ACC2 ACC3 MAR MDR Input Devices Output Devices Input Output Controller System Buses Input Output Controller A more detailed look at the von Neumann Architecture This slide highlights the use of buses and registers Primary Memory PC: Program Counter IR: Instruction Register Secondary Storage Devices MAR: Memory Address Register MDR: Memory Data Register ACC: Accumulator
45
Registers Storage locations internal to the CPU
Used as a scratchpad by the CPU to store data, addresses or instructions as it executes each program instruction Data can be moved into and out of registers faster than from memory – dedicated pathways Made from the fastest memory technology. Therefore, Expensive Relatively few (typically several dozen) Each register is wired for a specific purpose. Two broad types – general purpose and special purpose Common special purpose registers are: Program Counter (PC), Current Instruction Register (CIR), Memory Bus Register (MBR), Memory Data Register (MDR), Accumulator
46
Special Purpose Registers
Program Counter Register (PC) Contains the address of the next instruction to be execute Also called instruction pointer (IP) Current Instruction Register (IR) Holds the instruction that is being executed Memory Address Register (MAR) Holds the address of the next piece of data or instruction to be used Memory Data Register (MDR) Holds the data to be stored in memory / loaded from memory Accumulator Used by the ALU to perform arithmetic and logic operations
47
Central Processing Unit (CPU)
The Fetch-Execute Cycle At the start of the fetch-execute cycle the Program Counter contains the address of the next instruction to be executed. Central Processing Unit (CPU) Control Unit (CU) Arithmetic Logic Unit (ALU) Step 1. Fetch. The contents of the address in the PC are loaded from memory to the Instruction Register (IR) (via the MAR and MDR) PC IR Decode Execute ACC Step 2. Decode The control unit determines the type of instruction to be carried out and sets the control signals accordingly. MAR MDR Fetch (Store) Step 3. Execute The operation is carried out by the CU or the ALU (depending on the instruction – load and store operations are carried out by the CU while arithmetic and logical operations are carried out in the ALU). A more detailed look at the von Neumann Architecture This slide highlights the use of buses and registers Primary Memory (RAM) Step 4. Store The result of the operation is written to registers or RAM.
48
Basic Electronics Warmup Activity
49
Basic Electronics Voltage Current Resistors Capacitors Transistors
Some theory / instruction … Voltage, also called electromotive force, is a quantitative expression of the potential difference in charge between two points in an electrical field An electric current is a flow of electric charge. In electric circuits this charge is often carried by electrons moving through a wire A resistor is a device having resistance to the passage of an electric current. In electronic circuits, resistors are used to reduce current flow, adjust signal levels, to divide voltages, bias active elements, and terminate transmission lines, among other uses. A capacitor is a device used to store an electric charge, consisting of one or more pairs of conductors separated by an insulator. Its function is to store the electrical energy and give this energy again to the circuit when necessary. In other words, it charges and discharges the electric charge stored in it. Besides this, the functions of a capacitor are as follows: It blocks the flow of DC and permits the flow of AC. A transistor is a semiconductor device used to amplify or switch electronic signals and electrical power. It is composed of semiconductor material usually with at least three terminals for connection to an external circuit. Integrated Circuits Students learn about: CPU: ALU, Registers, Program counter, Memory / Basic electronics: voltage, current, resistors, capacitors, transistors
50
Recommended Viewing Full playlist
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.