1 / 50

Computer Systems

Computer Systems. Layers of a Computing System. 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.

ayersm
Télécharger la présentation

Computer Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Systems

  2. Layers of a Computing System

  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? Bits are used to represent numbers, text characters, images, sound, etc.

  4. ASCII Character Set

  5. ASCII Character Set

  6. Binary (bit) Addition Only four possible combinations of input: Truth Table Logic Gates (Circuit) Boolean Expressions

  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 (1815-64) The most common logic (Boolean) operations are: NOT AND OR XOR NAND NOR

  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 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

  10. The AND operation In order for the output to be 1 both inputs must be 1

  11. The OR operation 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 A NAND B = NOT (A AND B) NOR A NOR B = NOT (A OR B)

  14. The XOR (eXclusive OR) operation 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

  16. Complete the truth table for a Boolean expression

  17. Complete the truth table for a Boolean expression

  18. Using truth tables to verify identities Let’s say we wanted to investigate whether the identity holds Is NOT A AND NOT B = NOT (A AND B) ?

  19. Using truth tables to verify identities Investigate whether the identity holds

  20. Using truth tables to verify identities Distribution :

  21. Using truth tables to verify identities Distribution :

  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

  23. Using truth tables to verify identities - SOLUTIONS

  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

  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

  26. Create a Boolean Expression from a logic diagram

  27. Connect Logic Gates (to create circuits) Logic gates may be combined by using the output of one gate as the input to another.

  28. Connect Logic Gates (to create circuits) Circuits in which the output is determined solely by the current inputs are termed combinational logic circuits. A AND NOT B OR NOT A AND B = A XOR B

  29. Half-adder A SUM Half Adder An adder is a digital circuit that performs addition of numbers. B CARRY A half adder adds two binary digits and produces two outputs – the sum and the carry

  30. Half-adder Only four possible combinations of input:

  31. Half-adder B A SUM A CARRY B

  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 A SUM B CARRY

  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, A B SUM C

  37. Full-adder (circuit for CARRY) A B C CARRY

  38. Full-adder A A XOR B B SUM C 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

  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.

  41. Von Neumann Architecture Central Processing Unit (CPU) 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 Primary Memory Secondary Storage Devices 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.

  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. 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) Arithmetic Logic Unit (ALU) Control Unit (CU) IR PC ACC1 ACC3 ACC2 MAR MDR Input Devices Output Devices System Buses Input Output Controller Input Output Controller Primary Memory PC: Program Counter Secondary Storage Devices IR: Instruction Register 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

  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. 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) Decode Arithmetic Logic Unit (ALU) Execute Control Unit (CU) 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 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). Primary Memory (RAM) https://www.youtube.com/watch?v=jFDMZpkUWCw https://www.youtube.com/watch?v=04UGopESS6A Step 4. Store The result of the operation is written to registers or RAM.

  48. Basic Electronics

  49. Basic Electronics Voltage Current Resistors Capacitors Transistors Integrated Circuits Students learn about: CPU: ALU, Registers, Program counter, Memory / Basic electronics: voltage, current, resistors, capacitors, transistors

  50. Recommended Viewing https://www.youtube.com/results?search_query=crash+course+computer+science

More Related