Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSNB374: Microprocessor Systems Chapter 1: Introduction to Microprocessor.

Similar presentations


Presentation on theme: "CSNB374: Microprocessor Systems Chapter 1: Introduction to Microprocessor."— Presentation transcript:

1 CSNB374: Microprocessor Systems Chapter 1: Introduction to Microprocessor

2 Microprocessor-based Computer System A computer system consists of the following components: Microprocessor (CPU) Memory system I/O system These three components are interconnected by busses. This architecture applies to any computer system, from the earlier mainframe computers to the latest systems.

3 Microprocessor-based Computer System

4 The Microprocessor (CPU) The controlling element (the brain) of the a computer system. Controls memory and I/O by executing program stored in memory. A program is a series of instruction. Instruction is in machine language – string of 0’s and 1’s. The set of instructions used by a CPU is called the instruction set – unique for each CPU type.

5 The Microprocessor (CPU) Two main components of a CPU: Execution Unit (EU) The purpose is to execute instructions Contains the arithmetic logic unit (ALU) Data for operation by ALU are stored registers Bus Interface Unit (BIU) The purpose is to facilitate communication between the EU and the memory or I/O. Responsible for transmitting address, data and control signals on the busses.

6 Memory System The location where the information processed by the memory is stored. Each location in memory contains an 8-bit data (8 bits = 1 byte). The data stored in a memory byte are called contents. Each memory byte is accessed using an address. Specified using a hex number.

7 Memory System Two bytes of data form a word (16 bits). A pair of successive memory bytes can be treated as a single unit called a memory word. Accessed using the lower address of the two memory bytes. Intel processors store the least significant byte in the lower memory address (little endian). Data size can also be in doubleword (32 bits).

8 I/O System A computer communicates with the outside world through I/O devices. I/O devices are connected to the computer through I/O circuits. I/O circuits contains several registers called I/O ports. Some ports are used for data while others are used for control commands. I/O ports are accessed using I/O addresses (similar to memory addresses).

9 Busses A common group of wires that interconnect components in a computer system. Three types of busses: address, data and control. An operation may require data to be transmitted on all the three busses. Example: memory read. CPU places address of memory location on address bus. Control signal tells the memory to perform a read. Data is received from memory on data bus.

10 Busses

11 The size of the address bus determines the maximum memory size that can be supported. 32-bit systems has 32 pins for the address. Can support a maximum of 4GB of memory. The size of the data bus determines how much data can be transferred at a time. Many new microprocessors has 64-bit extensions. They have 64-bit data bus. But the address bus is still less than 64-bit.

12 Number Systems Use of microprocessor requires the working knowledge of number systems. Binary, decimal, hexadecimal. Decimal numbers: Base (radix) 10 Contains 10 different digits: 0 to 9 The one we use in everyday life Binary numbers: Base (radix) 2 Contains only 2 different digits: 0 and 1 The number representation used in digital circuits

13 Number Systems Hexadecimal numbers: Base (radix) 16 Contains 16 different digits: 0 to 9, A to F Normally written with ‘0x’ in front or with an ‘H’ at the back. Example: 91B7 16 = 0x91B7 = 91B7H Used as a compact way to represent binary numbers

14 Number System Conversions Binary to decimal (example): 1001 2 = (1x2 3 ) + (0x2 2 ) + (0x2 1 ) + (1x2 0 ) = 8 + 0 + 0 + 1 = 9 10 Hexadecimal to decimal (example): 610A 16 = (6x16 3 ) + (1x16 2 ) + (0x16 1 ) + (10x16 0 ) = 24576 + 256 + 0 + 10 = 24842 10

15 Number System Conversions Decimal to binary (example): Convert 43 10 to binary. 43 / 2 = 21 remainder 1 21 / 2 = 10 remainder 1 10 / 2 = 5 remainder 0 5 / 2 = 2 remainder 1 2 / 2 = 1 remainder 0 1 / 2 = 0 remainder 1 Therefore, 43 10 = 101011 2

16 Number System Conversions Decimal to hexadecimal (example): Convert 425 10 to hexadecimal. 425 / 16 = 26 remainder 9 26 / 16 = 1 remainder 10 (A) 1 / 16 = 0 remainder 1 Therefore, 425 10 = 1A9 16

17 Conversion Involving Fractional Numbers Binary to decimal (example): 0.011 2 = (0x2 -1 ) + (1x2 -2 ) + (1x2 -3 ) = 0 + 0.25 + 0.125 = 0.375 10 10.11 2 = (1x2 1 )+(0x2 0 )+(1x2 -1 )+(1x2 -2 ) = 2 + 0 + 0.5 + 0.25 = 2.75 10 Hexadecimal to decimal (example): 0.A8 16 = (10x16 -1 ) + (8x16 -2 ) = 0.625 + 0.03125 = 0.65625 10

18 Conversion Involving Fractional Numbers Decimal to binary (example): Convert 0.375 10 to binary. 0.375 x 2 = 0.75  0 0.75 x 2 = 1.5  1 0.5 x 2 = 1.0  1 0 x 2 = 0 Therefore, 0.375 10 = 0.011 2

19 Conversion Involving Fractional Numbers Decimal to hexadecimal (example): Convert 0.1208496 10 to hexadecimal. 0.1208496 x 16 = 1.9335938  1 0.9335938 x 16 = 14.9375  E 0.9375 x 16 = 15.0  F 0 x 16 = 0 Therefore, 0.1208496 10 = 0.1EF 16

20 Binary-coded Hexadecimal Refers to the use of binary to represent a hexadecimal number. Example: HexadecimalBinary 9A1001 1010 310011 0001 F21111 0011 DC1101 1100

21 Binary and Hexadecimal Arithmetic In general, addition and subtraction in other number systems are performed in a similar way to addition and subtraction in decimal. However, there is a minor difference. Addition: Digit position can only contain the maximum digit permitted by the number system. If addition of two digits result in a number higher than the maximum digit, there will be a carry. Subtraction: When a borrow is performed, the borrowed value will be the value of the number system’s radix.

22 Unsigned and Signed Integers Unsigned integers can only represent positive numbers. If the hardware can store 8-bits, the integer that can be stored ranges from 0 to 255. Signed integers can represent both positive and negative numbers. The value of the MSB tells whether the number is positive or negative. If the hardware can store 8-bits, the integer that can be stored ranges from -128 to +127.

23 Unsigned and Signed Integers In theory, there are three ways to represent negative integers in binary: Using a sign bit 1’s complement 2’s complement Example: Assuming an 8-bit hardware, represents -10 in binary. Using a sign bit: 10001010 1’s complement: 11110101 2’s complement: 11110101 + 1 = 11110110

24 Unsigned and Signed Integers In all microprocessor systems, signed integers are represented using 2’s complement. Advantage of 2’s complement: Subtraction can be performed using addition. Simplifies the ALU circuitry. Example: 20 10 – 10 10 = 20 10 + (-10 10 ) = 00010100 2 + 11110110 2 = 00001010 2

25 Unsigned and Signed Integers

26 Floating Point Numbers Representing a number as an integer that has certain number of bits can seriously limit the values that can be represented. What if we want to represent a very large number? Or a number with decimal point? Floating point number refers to a way to represent real numbers which supports a wide range of values. Format: M x 10 E M – mantissa / significand / fraction E – exponent

27 Floating Point Numbers Example: Representing a very large number. 5500000000000000000 = 55 x 10 17 Example: Representing a number with decimal point. 2.934 = 2934 x 10 -3 Single-precision floating point number has 32 bits. Double-precision floating point number has 64 bits.

28 Floating Point Numbers (a)Single precision floating point number format (b)Double precision floating point number format


Download ppt "CSNB374: Microprocessor Systems Chapter 1: Introduction to Microprocessor."

Similar presentations


Ads by Google