basic architecture lecture 15. in general, if the number of bits is n, then the number of different...

12
Basic Architecture Lecture 15

Upload: maryann-white

Post on 12-Jan-2016

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Basic Architecture Lecture 15. In general, if the number of bits is n, then the number of different combinations of 0s and 1s that can be made is 2 n

Basic Architecture

Lecture 15

Page 2: Basic Architecture Lecture 15. In general, if the number of bits is n, then the number of different combinations of 0s and 1s that can be made is 2 n

In general, if the number of bits is n, then the number of different combinations of 0s and 1s that can be made is 2n. These binary numbers can be used as addresses for the external memory. The memory consists of a number of "compartments" that contain a byte of data, and each compartment has a unique address. So, if 8 bits are used for an address, there can be 28 or 256 different addresses.

Page 3: Basic Architecture Lecture 15. In general, if the number of bits is n, then the number of different combinations of 0s and 1s that can be made is 2 n

If the address has 16 bits, then 216 different locations can be addressed. As each location holds a single byte, 216 bytes can be stored or 64Kb.

Page 4: Basic Architecture Lecture 15. In general, if the number of bits is n, then the number of different combinations of 0s and 1s that can be made is 2 n

In parallel with this has been the development of the microcomputers or microcontrollers. These are microprocessors that are embedded within systems. The main difference between microcontrollers and microprocessors is that they have some memory on the same chip as the processor and often some other peripheral devices.

Page 5: Basic Architecture Lecture 15. In general, if the number of bits is n, then the number of different combinations of 0s and 1s that can be made is 2 n

In the majority of embedded systems the programs that are run are small compared to general purpose packages found in PCs, so they can be stored within the memory on the chip. Not only does this reduce the number of chips needed, but also helps to speed up the process. Very often this is a key factor in embedded systems where the programs are expected to operate in real-time i.e. very fast.

Page 6: Basic Architecture Lecture 15. In general, if the number of bits is n, then the number of different combinations of 0s and 1s that can be made is 2 n

Questions

(a) A microprocessor has a 16 bit address path. How many different memory locations can it access?

(b) If a memory has 2048 bytes, with each byte having a unique address, how many bits are needed in the address?

Page 7: Basic Architecture Lecture 15. In general, if the number of bits is n, then the number of different combinations of 0s and 1s that can be made is 2 n

MEMORY

10 11 12 13 14 15 16 17 18 19

ADDRESS

ALU

CU

SP

PC

MAR

IR

A

I/O

REGISTER

MICROPROCESSOR

CLOCKK DATA

ADDRESS

READ/WRITE

PSW

Page 8: Basic Architecture Lecture 15. In general, if the number of bits is n, then the number of different combinations of 0s and 1s that can be made is 2 n

Arithmetic and Logic Unit (ALU) This carries out arithmetic operations such as adding or subtracting, and logical operations.

Control Unit (CU) This controls the execution of instructions and controls the fetch processes.

Input and Output Ports (I/O) Communicates with the outside world, either reading in data or sending data out.

Clock This produces regular pulses which controls the rate at which instructions are carried out.

Page 9: Basic Architecture Lecture 15. In general, if the number of bits is n, then the number of different combinations of 0s and 1s that can be made is 2 n

Registers

A register is a small storage unit which holds a single piece of data. Usually temporary storage.

We have already met a few of these, but there are many some of these are shown below:

– Accumulator (Register A) A general purpose register that holds the data that is being processed.

– Stack Pointer (SP) Contains the address of the instruction that called a subroutine.

Page 10: Basic Architecture Lecture 15. In general, if the number of bits is n, then the number of different combinations of 0s and 1s that can be made is 2 n

Program Status Word (PSW)

This register contains information about the result of operations such as if the result is for example:– negative – Zero– Carry occurred– interrupts

Page 11: Basic Architecture Lecture 15. In general, if the number of bits is n, then the number of different combinations of 0s and 1s that can be made is 2 n

Summary

Looked at parts of the basic architecture The relationship between the number of bits in an

address and the number of locations that can be stored.

Considered what the following do:– Arithmetic and Logic Unit (ALU)– Control Unit (CU).– Input and Output Ports (I/O).– Clock

Page 12: Basic Architecture Lecture 15. In general, if the number of bits is n, then the number of different combinations of 0s and 1s that can be made is 2 n

Register is a small storage unit which holds a single piece of data.