Computer Architecture and Hardware Introduction and revision Slides heavily based on Adrian Shaw’s material.

Slides:



Advertisements
Similar presentations
Combinational Circuits
Advertisements

Week 3. Assembly Language Programming  Difficult when starting assembly programming  Have to work at low level  Use processor instructions >Requires.
1 Chapter 2 The Digital World. 2 Digital Data Representation.
EE1A2 Microprocessor Systems & Digital Logic Part I Digital Electronic System Design Dr. T. Collins.
The 8085 Microprocessor Architecture
Processor System Architecture
DH2T 34 Computer Architecture 1 LO2 Lesson Two CPU and Buses.
CSC1016 Coursework Clarification Derek Mortimer March 2010.
CS 61C L02 Number Representation (1)Harvey / Wawrzynek Fall 2003 © UCB 8/27/2003  Brian Harvey ( John Wawrzynek  (Warznek) (
1 Foundations of Software Design Lecture 3: How Computers Work Marti Hearst Fall 2002.
Level ISA3: Information Representation
Chapter 0 Introduction to Computing
CS 61C L02 Number Representation (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C.
CSC 110 – Intro to Computing Lecture 14: Midterm Review.
Lecture 4: Computer Memory
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ input/output and clock inputs Sequence of control signal combinations.
System Environment Part 1 The Register Level. Module Content “Systems environment” is a term used to describe the hardware and software structures which.
Topic 4 Computer Mathematics and Logic
CMSC 104, Version 9/01 1 Machine Architecture and Number Systems Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The.
Real Numbers and the Decimal Number System
Aug CMSC 104, LECT-021 Machine Architecture and Number Systems Some material in this presentation is borrowed form Adrian Ilie From The UNIVERSITY.
CENG 311 Machine Representation/Numbers
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
Computers Organization & Assembly Language
1 Machine Architecture and Number Systems Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number System Converting.
Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar.
CSU0014 Assembly Languages Homepage: Textbook: Kip R. Irvine, Assembly Language for Intel-Based Computers,
Binary Numbers.
Summer 2014 Chapter 1: Basic Concepts. Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Chapter Overview Welcome to Assembly Language.
Introduction to Computing Systems from bits & gates to C & beyond Chapter 3 Digital Logic Structures Transistors Logic gates & Boolean logic Combinational.
CS1Q Computer Systems Lecture 9 Simon Gay. Lecture 9CS1Q Computer Systems - Simon Gay2 Addition We want to be able to do arithmetic on computers and therefore.
CS1Q Computer Systems Lecture 8
Computer Systems Organization CS 1428 Foundations of Computer Science.
Computers Are Your Future Eleventh Edition Chapter 2: Inside the System Unit Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall1.
Machine Architecture CMSC 104, Section 4 Richard Chang 1.
1 The Chinese University of Hong Kong Faculty of Education Diploma in Education (Part-Time) Winter 1997 Educational Communications and Technology Assignment.
1 DIGITAL ELECTRONICS. 2 OVERVIEW –electronic circuits capable of carrying out logical (boolean) and arithmetic operations on information stored as binary.
Computer Math. The Decimal System How do we represent “One Hundred and Twenty Five”? How do we represent “One Hundred and Twenty Five”? Simple: 125 !!!
The CPU Central Processing Unit. 2 Reminder - how it fits together processor (CPU) memory I/O devices bus.
Computer Organization - 1. INPUT PROCESS OUTPUT List different input devices Compare the use of voice recognition as opposed to the entry of data via.
CSNB374: Microprocessor Systems Chapter 1: Introduction to Microprocessor.
Data Representation Conversion 24/04/2017.
Chapter 4 MARIE: An Introduction to a Simple Computer.
Data Representation Bits, Bytes, Binary, Hexadecimal.
INTRODUCTION.  Upon completing this topic, you should be able to: Illustrate a basic elements of digital computer system and their functions, Depicts.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
CS 232: Computer Architecture II Prof. Laxmikant (Sanjay) Kale.
Stored Programs In today’s lesson, we will look at: what we mean by a stored program computer how computers store and run programs what we mean by the.
Machine Architecture and Number Systems
Electronic Analog Computer Dr. Amin Danial Asham by.
CMSC Machine Architecture and Number Systems Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number.
Introduction to Microprocessors - chapter3 1 Chapter 3 The 8085 Microprocessor Architecture.
CS1Q Computer Systems Lecture 8
CO5023 Latches, Flip-Flops and Decoders. Sequential Circuit What does this do? The OUTPUT of a sequential circuit is determined by the current output.
Introduction to Computing Systems and Programming Digital Logic Structures.
Logic Gates Dr.Ahmed Bayoumi Dr.Shady Elmashad. Objectives  Identify the basic gates and describe the behavior of each  Combine basic gates into circuits.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ read/write and clock inputs Sequence of control signal combinations.
Digital Logic. December 0s and 1s As we have already considered, a computer operates on 0’s and 1’s Why? Because the power on a line.
Computer Architecture and Number Systems
Morgan Kaufmann Publishers
THE CPU i Bytes 1.1.
Machine Architecture and Number Systems
Chapter One: Introduction
Machine Architecture and Number Systems
Machine Architecture and Number Systems
Machine Architecture and Number Systems
ECE 352 Digital System Fundamentals
Microprocessor I 7/18/2019.
Machine Architecture and Number Systems
Presentation transcript:

Computer Architecture and Hardware Introduction and revision Slides heavily based on Adrian Shaw’s material

CS25410 Semester 1 75% Examination + 25% Assignment Assignment - Assembly Language Program LC-3 Virtual Computer – 16 bit 2

What do we cover? Arithmetic review Logic and Logic Circuit Review CPU/Memory/Bus Multiplexers, Address decoders Machine code Assembly Language/Assembler/Simulator I/O Basic Electricity and Power Storage 3

4 Recommended Texts Tocci & Ambrosio: Microprocessors & Microcomputers –Physical Sciences Library: QA76.5.T6 –Note 6 th edition is out, but is a lot more expensive. 5 th edition is fine Patt & Patel: Introduction to Computing Systems – McGraw Hill

Let’s talk about numbers 5

6 The Digital Computer Computers (as we know them) work on 1’s and 0’s –Nothing else All commands to the CPU are just strings of these All output from the CPU is in strings of these

7 So we need to understand binary? Yes. To understand how a computer works, you have to understand how it uses numbers. You should be able to: –Convert from binary to decimal, and vice-versa –Do simple sums in binary Can you do this already? You should be able to! Quick revision….

8 Binary Otherwise known as base 2 Each 1 or 0 is called a bit We can string bits together to form a byte A byte is (normally) 8 bits e.g We are not good at reading binary - we like to read numbers as decimal But to understand the computer, we need to understand binary

9 Binary to Decimal Taking our example: ←Most significant bit …….. Least significant bit→ s64s32s16s8s4s2s1s 1×128 0×640×321×161×81×40×21x = 157

10 Decimal to Binary e.g Yes Yes1 9-32No0 9-16No0 9-8Yes1 1-4No0 1-2No0 1Yes1

11 Why these numbers? BinaryDecimalPower of

12 It’s the same method as in Decimal! DecimalPower of

13 But Decimal is clumsy 8 bits (1 byte) we can represent different numbers So we often use hexadecimal (hex for short) Hexadecimal is base 16

14 Hexadecimal But there are only ten symbols to represent numbers, how can we manage to represent numbers from 10 to 15 with a single digit? We use the letters A to F So our counting goes… A B C D E F

15 Hexadecimal HexDecimalPower of

16 Why is Hex better? One byte = 8 bits 256 = 2 8 = 16 2 = = 2 4 This means each four bits can be represented by one hex digit e.g = B2 16 Binary HexB2 Note use of subscript to denote base

17 Arithmetic in other bases It’s just like in Decimal, except you have to remember to ‘carry’ at the right point – F +84 C3 43 –2E 15 Binary Hexadecimal

18 Arithmetic in other bases (2) If you find that too confusing, you can always: –Convert the numbers to decimal –Do the sums –Convert the answer back to the original base But you might not notice if a carry or a borrow happened; this becomes important later (though there are other ways you can tell)

19 Bases - Summary Make sure you can… –Convert between binary, decimal and hex (without a calculator!) –Do simple sums in binary and hex (just addition and subtraction) Tip: Learn to recognise the powers of 2 (2,4,8,16,32,64,128,256) and 16 (16,256) rather than having to work them out each time you need them

20 Do it now! I really can’t stress this enough… Don’t wait until revision time; stuff later in the course relies heavily on you knowing this. You may get lost if you don’t do it now.

Digital Logic (Revision)

22 0’s and 1’s As we have already considered, a computer operates on 0’s and 1’s –Why? Because the power on a line can be either off (0) or on (1). We do not consider in- between values! How does a computer carry out calculations on these 0’s and 1’s? –It uses logic

23 Logic By logic, we mean the process of testing the input on one or more input lines, to produce output on one or more output lines We use the terms AND, OR, NOT, NAND, NOR, and XOR

24 AND: Truth Table If A AND B are both TRUE –then result is also TRUE ABAB Truth table for AND Note signifies AND

25 OR: Truth Table If either A OR B (or both) are TRUE –Then result is TRUE ABA+B Note + signifies OR

26 Exclusive OR! Except, beware: If A OR B are TRUE – but NOT both of them –Then result is TRUE This is called the Exclusive OR (XOR) AB ABAB

27 NOT The simplest of all. It just inverts the input AA We signify NOT by a line over the corresponding letter(s)

28 NAND This is simply the opposite of AND ABAB AB

29 NOR Similarly, this is the opposite of OR ABA+B AB

30 Logic Gates A logic gate is a device (e.g. on a chip) which takes one or more inputs, performs a logical operation on them (such as AND, OR, etc) and produces an output On a circuit diagram, we have special symbols for these

31 Logic Gates ANDNANDNOT ORNORXOR

32 Multiple Input Logic Gates All the logic gates on the previous slide, except the NOT gate, may have multiple inputs. What do you think the truth table would be for a three-input AND gate?

33 Revision Make sure you know what each gate symbol stands for Know the truth tables for each logic gate Learn the digital logic expressions for each gate Again, do it NOW! Don’t wait.

Memory How a computer stores information (still revision)

35 Basic Computer Architecture processor (CPU) memory I/O devices bus

36 What is memory? A collection of individual storage cells These cells are known as locations Each location can store a fixed number of bits Each has a unique address

37 Memory example Address (binary) Address (hex) Contents Example data only

38 Hex address We tend to use Hex, it’s easier than binary to remember, and closer related to the binary than decimal is As an assembly language programmer, you will often have to refer to addresses. You will find this out for yourselves later in the course – so get used to it!

39 Jargon A byte is (usually) 8 bits of data, e.g For the purposes of this course, we will assume we always mean 8 bits when we talk about a byte Don’t get confused between bytes and bits – it’s easily done. e.g. we talk of a 256 megabyte memory chip, but a 56 kilobit modem or 8 megabit broadband. Remember this when estimating transfer times!!!

40 More confusion What is a kilobyte? You’d think it would be 1000 bytes, right? Wrong. Well, usually. A kilobyte is usually 1024 byte (2 10 ) In 2000, the International Electrotechnical Commission defined the terms kibi-, mibi-, gibi- and tebi- byte for , , and bytes (symbols KiB, MiB, GiB, TiB), but they certainly aren’t universally used

41 More jargon A word of memory is the contents of a single memory location So an n-bit word is a word comprising n bits of data, e.g. a 16-bit word, or a 32-bit word An n-bit machine is a processor designed to work mainly with n-bit words Operating systems – 16 bit, 32 bit, 64 bit…

42 Basic Memory Unit 1-bit memory enable read/write control data in data out or a single data I/O line

43 Basic Memory Unit (2) But we deal with words of memory, and we read or write the whole word at a time So we only need one enable line and one read/write line for the whole word But we still need separate data I/O lines (why?)

44 One (4-bit) word of memory 1 bit common enable common read/write control data I/O

The Bus A collection of wires which carry data between the CPU, memory and I/O devices

46 Components of the Bus Address Bus carries memory address values from the CPU to the memory and I/O Data Bus carries all data, including machine codes, in all directions Control Bus a small number of wires carrying the read/write and enable signals, and a few other “control” signals

47 Important Bus Parameters Width of the address bus Determines the size of the address space – i.e. how many locations can be addressed Width of the data bus Determines how much data can be transferred in a single data transfer cycle (thus affecting the speed). Usually the same as the machine (and memory) word size Bus Speed The number of transfers possible per second

48 Bus Width An address or data bus that contains n wires, or lines, is said to be n lines wide. Such a bus can carry an n-bit number in a single operation This does not apply to the control bus, as it only needs to carry simple control signals

49 Example 8-bit Bus 8 lines physically… but on a circuit diagram…8

50 Address Space An n bit address bus can carry any address that fits into an n bit binary number Therefore, it can carry 2 n possible addresses These will be 0 to 2 n -1 e.g. an address bus with 16 lines can address 2 16 (=65536) locations; a 32 line address bus can address 2 32 (=4,294,967,296) locations

51 Bus Cycles Bus cycle A single data transfer operation over the bus. The speed of this operation is governed by the bus speed, and affects the speed of the computer Read cycle A bus cycle in which data is read by the CPU from memory or an I/O device Write cycle A bus cycle in which data is written by the CPU to memory or an I/O device

52 Example: Bus Read Cycle undefined control bus lines

53 Bus Read Cycle t 1 CPU puts address on address bus and sets R/W line to 1 (=read) t 2 CPU asserts Valid Address line on control bus t 3 memory responds by putting data on data bus t 4 CPU reads data from data bus, and stops asserting valid address. Next cycle begins

54 Data Throughput The data throughput rate is the number of bytes (or bits) that can be transferred over the bus in one second. Therefore, it is the product of the bus speed (cycles per second) and the data bus width (bits per cycle)

55 Data Throughput Example A 16-bit data bus running at 10 million cycles per second (10 Megahertz) has a data throughput rate of 20 million bytes (or 160 million bits) per second Data throughput rate is a major limitation on the speed of a computer. That is why powerful computers have very wide data buses

56 Who Controls the Bus? In a simple system, always the CPU –but note DMAC later in this course For each bus cycle, the CPU must: –specify the address –select read or write –supply the data, if it’s a write

57 Addressing I/O Devices The Problem all data traffic from the CPU has to go down the data bus all addressing has to go down the address bus –but memory uses this address space already

58 Addressing I/O Devices The Solution There are two common ways to solve this problem 1.Give I/O devices a separate address space (how?) 2.Allow I/O devices to share the same address space as memory

59 Separate I/O address space Uses the control bus to specify whether we’re addressing memory or I/O Memory responds only if Memory Select is active; I/O only if I/O select is active This method requires the CPU to have separate machine codes for memory and I/O read and writes –Why?

60 Same address space When I/O devices share the same address space as memory, it is known as Memory-Mapped I/O I/O devices are given specific addresses in the memory address space. Reads and writes to these addresses access I/O devices instead of memory This does not require separate machine codes, since the value of the address is sufficient to distinguish between I/O and memory

61 Test Yourself! 1.What is the data throughput rate, in bytes, of a 32-bit data bus running at 20 Megahertz? 2.How many locations can an 8-bit address bus address? 3.True or false – all buses are bi-directional 4.Can you draw a timing diagram for a bus read cycle, identifying the lines, and the four key time points? 5.What is Memory-Mapped I/O?