1.1. microcomputer functional blocks -...

29
© Microprocessor Architecture § 1 Corneliu BURILEANU 1 1. MICROCOMPUTER STRUCTURE. DEFINITIONS 1. MICROCOMPUTER STRUCTURE. DEFINITIONS 1.1. Microcomputer Functional Blocks 1.1. Microcomputer Functional Blocks The Microcomputer The Microcomputer as a as a VON NEUMANN VON NEUMANN machine: a programmable system for information machine: a programmable system for information processing with two inseparable and defining components: processing with two inseparable and defining components: - - hardware; hardware; - - software. software.

Upload: dangcong

Post on 19-Feb-2018

228 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

1

1. MICROCOMPUTER STRUCTURE. DEFINITIONS1. MICROCOMPUTER STRUCTURE. DEFINITIONS

1.1. Microcomputer Functional Blocks1.1. Microcomputer Functional Blocks

The MicrocomputerThe Microcomputer as a as a ““VON NEUMANNVON NEUMANN”” machine: a programmable system for information machine: a programmable system for information processing with two inseparable and defining components:processing with two inseparable and defining components:-- hardware;hardware;-- software.software.

Page 2: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

2

A. The hardware;A. The hardware;

the functional blocks are:the functional blocks are:

1. The CENTRAL PROCESSING UNIT (CPU); two essential functions:1. The CENTRAL PROCESSING UNIT (CPU); two essential functions:•• Data processing;Data processing;•• Control of the entire microcomputer.Control of the entire microcomputer.

A central processing unit, with the two functions mentioned abovA central processing unit, with the two functions mentioned above, which supervises a e, which supervises a functionally structured system as in the figure, on one chip, wifunctionally structured system as in the figure, on one chip, will be called a ll be called a MICROPROCESSORMICROPROCESSOR((µµPP).).

2. The 2. The MEMORYMEMORY is a sequence of locations for data storing. Every location is is a sequence of locations for data storing. Every location is defined by two defined by two information entities:information entities:

Page 3: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

3

•• The ContentThe Content: binary digits 0 or 1 (: binary digits 0 or 1 (““bitsbits””););-- numbers;numbers;-- codes etc.codes etc.

The number of binary digits in a memory location depends on the The number of binary digits in a memory location depends on the way the microprocessor organizes the way the microprocessor organizes the information in the memory; the location dimension will be calledinformation in the memory; the location dimension will be called the the memory formatmemory format, expressed in bits , expressed in bits (usually 8, 16, 32 or 64 bit).(usually 8, 16, 32 or 64 bit).

•• The addressThe address: a number which is the unique location identifier in the sequen: a number which is the unique location identifier in the sequence.ce.

Related terms:Related terms:-- ““The memory mapThe memory map””: all the memory locations that can be addressed by a : all the memory locations that can be addressed by a

microprocessor.microprocessor.

-- ““PagesPages”” and/or and/or ““segmentssegments””: logical parts of the memory map with static : logical parts of the memory map with static or dynamic dimensions; they depend on the way one microprocessoror dynamic dimensions; they depend on the way one microprocessor organizes organizes the memory.the memory.

Page 4: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

4

The physical structure of a microcomputer memory consists of oneThe physical structure of a microcomputer memory consists of one or several chips. The total or several chips. The total amount of information storage in a microcomputer is defined amount of information storage in a microcomputer is defined ““the internal memorythe internal memory””. The . The internal memory does not necessarily cover the memory map of a cinternal memory does not necessarily cover the memory map of a certain microprocessor.ertain microprocessor.

In a microcomputer, there are two types of information:In a microcomputer, there are two types of information:

-- Data memoryData memory contains operands and/or results; this is a contains operands and/or results; this is a ““RAMRAM”” (random access (random access memory).memory).

-- Program MemoryProgram Memory contains instructions; usually, (not compulsory) this is a contains instructions; usually, (not compulsory) this is a ““ROMROM””(read(read--only memory).only memory).

The instructionThe instruction: binary coded information intended to specify for the microproc: binary coded information intended to specify for the microprocessor which specific essor which specific action will occur. action will occur.

Page 5: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

5

Remarks:Remarks:

•• Every instruction is associated with a binary sequence named a Every instruction is associated with a binary sequence named a ““codecode””..

•• An instruction is an elementary action, with a specified resultAn instruction is an elementary action, with a specified result, in the microcomputer , in the microcomputer activity having a activity having a specified CPUspecified CPU. .

•• One specified microprocessor is able to One specified microprocessor is able to ““recognizerecognize”” and execute only the codes for its own and execute only the codes for its own instructions; all the instructions that are recognized and execuinstructions; all the instructions that are recognized and executed by a microprocessor define the ted by a microprocessor define the instruction setinstruction set of this microprocessor.of this microprocessor.

•• The instruction sequence in the memory program is not fuzzy; insThe instruction sequence in the memory program is not fuzzy; instead, they are organized logically, tead, they are organized logically, according with an algorithm, in according with an algorithm, in programsprograms, in order to accomplish a given , in order to accomplish a given tasktask. A task is not a . A task is not a program; in a task, the hardware and software resources are dynaprogram; in a task, the hardware and software resources are dynamically allocated. mically allocated.

Page 6: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

6

The significance of the memory location content is established bThe significance of the memory location content is established by the programmer, y the programmer, according with the specific functions achieved by the microproceaccording with the specific functions achieved by the microprocessor: ssor:

-- binary numbersbinary numbers when we are dealing with operands/results);when we are dealing with operands/results);

-- codescodes when we are dealing with instructions.when we are dealing with instructions.

In the given function block of the microcomputer, the memory hasIn the given function block of the microcomputer, the memory has no control on the no control on the stored information meaning, whatsoever.stored information meaning, whatsoever.

Page 7: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

7

3. INPUT/OUTPUT DEVICES (I/O): the circuits that achieve the con3. INPUT/OUTPUT DEVICES (I/O): the circuits that achieve the connection between the nection between the microcomputer and the outside world. One item of these devices imicrocomputer and the outside world. One item of these devices is defined as s defined as ““input/output input/output portport””..

The I/O ports and the memory have several similarities:The I/O ports and the memory have several similarities:

-- The I/O ports are also information storing locations that can bThe I/O ports are also information storing locations that can be addressed e addressed (operands/results).(operands/results).

-- We can define We can define ““an I/O port mapan I/O port map”” that is or is not part of the memory map.that is or is not part of the memory map.

The only difference between ports and memory is The only difference between ports and memory is the physical connection with outside the physical connection with outside worldworld that ports are able to provide; for the microprocessor, this cothat ports are able to provide; for the microprocessor, this connection is transparent in nnection is transparent in with no significance.with no significance.

Page 8: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

8

““The busThe bus””: a set of physical connections with the function blocks, having: a set of physical connections with the function blocks, having a specific flow of a specific flow of information. We are talking about a unique bus; functionally, thinformation. We are talking about a unique bus; functionally, there are three components:ere are three components:

1. 1. Data busData bus, bi, bi--directional, for data (operands/results), instructions and even directional, for data (operands/results), instructions and even addresses. addresses.

2. 2. Address busAddress bus, unidirectional, allows the microprocessor to identify the info, unidirectional, allows the microprocessor to identify the information in rmation in the memory or I/O ports; so the only flow is the address flow.the memory or I/O ports; so the only flow is the address flow.

3. 3. Control busControl bus, bi, bi--directional, for the command and control signals from/to the directional, for the command and control signals from/to the microprocessor, as the CPU oh the entire system.microprocessor, as the CPU oh the entire system.

Page 9: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

9

B. The software: programs specifically organized. B. The software: programs specifically organized.

Two categories of software:Two categories of software:

1. 1. The operating systemThe operating system: all programs allowing complete access to the system resources.: all programs allowing complete access to the system resources.(Examples: MS(Examples: MS--DOS, UNIX etc.). Could be: resident (permanent in internal memorDOS, UNIX etc.). Could be: resident (permanent in internal memory) y) or external. (or external. (““bootstrapbootstrap”” -- loading operating system).loading operating system).

2. 2. User SoftwareUser Software, all programs used to accomplish specified tasks., all programs used to accomplish specified tasks.

Page 10: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

10

““Von NeumannVon Neumann””characteristics:characteristics:

·· The microprocessor is the Central Processing UnitThe microprocessor is the Central Processing Unit-- two functions: control, processing.two functions: control, processing.

·· No other system component controls the significance of the inforNo other system component controls the significance of the information.mation.

·· Single Bus with three components; on Data Bus there are all typeSingle Bus with three components; on Data Bus there are all types of information.s of information.

·· This is a programmable system; each program is a sequence of insThis is a programmable system; each program is a sequence of instructions; each tructions; each

instruction is read from memory by the CPU, instruction is read from memory by the CPU, ““recognizedrecognized”” and the executed. and the executed.

The Architecture:The Architecture:

all system (in our case, the microprocessor) attributes that areall system (in our case, the microprocessor) attributes that are available (available (““visiblevisible””) to ) to

the user (such as: registers, addressing modes, data transfer tythe user (such as: registers, addressing modes, data transfer types, logical memory management, pes, logical memory management,

I/O techniques, the instruction set etc.).I/O techniques, the instruction set etc.).

Page 11: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

11

1.2. 1.2. CISC and RISC MicroprocessorsCISC and RISC Microprocessors

•• Microprocessor, microcomputer, minicomputerMicroprocessor, microcomputer, minicomputer

Similarity: global architecture characteristics.Similarity: global architecture characteristics.

Differences between the last two: the resources (internal and exDifferences between the last two: the resources (internal and external memory, ternal memory, periphery) and performances (processing speed, cost, component nperiphery) and performances (processing speed, cost, component number).umber).

•• Microprocessor definition as Central Processing Unit; we have Microprocessor definition as Central Processing Unit; we have implied that CPU is part of a implied that CPU is part of a computing system. The microprocessor could also be the CPU of ancomputing system. The microprocessor could also be the CPU of any control and command system y control and command system as a as a ““controllercontroller””).).

•• ““Programmed LogicProgrammed Logic””. Programmed Logic systems are not, necessarily, microprocessor . Programmed Logic systems are not, necessarily, microprocessor driven systems. Only part of them is. Do no confuse driven systems. Only part of them is. Do no confuse ““microprocessor driven programmed microprocessor driven programmed logic systemlogic system”” with with ““microprogrammedmicroprogrammed systemsystem””..

Page 12: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

12

Classifications:Classifications:

a) Data bus criterion: 8, 16, 32 or 64 bit microprocessors.a) Data bus criterion: 8, 16, 32 or 64 bit microprocessors.

b) Task criterion: b) Task criterion:

•• general purpose microprocessors (general purpose microprocessors (GPGPµµPP), no specific tasks;), no specific tasks;

•• specialized microprocessors:specialized microprocessors:

-- I/O processors, for complex information exchange between the miI/O processors, for complex information exchange between the microcomputer and the crocomputer and the

outside world; for example: Intel 8089;outside world; for example: Intel 8089;

-- arithmetic coprocessors, for specific tasks in math processing;arithmetic coprocessors, for specific tasks in math processing; for example: Intel 80387;for example: Intel 80387;

-- digital signal processors, for specific tasks such asdigital signal processors, for specific tasks such as FFTFFT, digital filters, multidimensional , digital filters, multidimensional

array processing; for example: Texas Instruments TMS 320.array processing; for example: Texas Instruments TMS 320.

c) Architecture characteristics criterion:c) Architecture characteristics criterion:

•• CISCCISC: complex instruction set computers, also named : complex instruction set computers, also named ““standardstandard”” microprocessors;microprocessors;

•• RISCRISC: reduced instruction set computers.: reduced instruction set computers.

Page 13: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

13

1.3. 1.3. Information Representation in Digital SystemsInformation Representation in Digital Systems

-- bitbit (abbreviation (abbreviation bb) for a binary digit 0 or 1;) for a binary digit 0 or 1;-- nibblenibble (abbreviation (abbreviation nn) for an array of 4 bits;) for an array of 4 bits;-- bytebyte or or octetoctet (abbreviation (abbreviation BB) for an array of 8 bits;) for an array of 8 bits;-- wordword (abbreviation (abbreviation ww) for an array of 2 bytes;) for an array of 2 bytes;-- double worddouble word (abbreviation(abbreviation dwdw) for an array of 4 bytes.) for an array of 4 bytes.

Prefixes:Prefixes: •• k for 2k for 21010 ≈≈ 101033 ;;•• M for 2M for 22020 ≈≈ 101066 ;;•• G for 2G for 23030 ≈≈ 101099 ;;•• T for 2T for 24040 ≈≈ 10101212 ;;•• P for 2P for 25050 ≈≈ 10101515 ; (; (petabitpetabit))•• E for 2E for 26060 ≈≈ 10101818 ; (; (exabitexabit))•• Z for 2Z for 27070 ≈≈ 10102121 ; (; (zettabitzettabit))•• Y for 2Y for 28080 ≈≈ 10102424 ; (; (yottabityottabit))

Page 14: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

14

1.3.1 Internal Representation1.3.1 Internal Representation

a) Program representationa) Program representation

Each instruction is represented in the memory as a binary code.Each instruction is represented in the memory as a binary code.

Instruction formatInstruction format: all binary numbers required to code the entire information rel: all binary numbers required to code the entire information related to the ated to the instruction. Usually, the format is byte multiple. Microprocessoinstruction. Usually, the format is byte multiple. Microprocessors have a predefined number of rs have a predefined number of bytes for every instruction (for example, IA 32 microprocessors bytes for every instruction (for example, IA 32 microprocessors have instruction with 1 to 15 have instruction with 1 to 15 bytes).bytes).

Page 15: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

15

b) Number representationb) Number representation

1) 1) Unsigned integersUnsigned integers in in ““natural binarynatural binary””: is the usual, : is the usual, ““naturalnatural””, representation of binary , representation of binary numbers.numbers.

8 digits binary number =8 digits binary number = with with bbi i ∈∈ {0, 1}{0, 1}

8 digits binary number = 8 digits binary number = bb77bb66bb55bb44bb33bb22bb11bb00bb00 : lsb : lsb –– least significant bitleast significant bit

bb77 : msb : msb –– most significant bitmost significant bit

bi

i

i

=∑

0

7

2

2) 2) Signed integersSigned integers in in ““natural binarynatural binary””: :

The number sign is msb:The number sign is msb:msb = 0 means positive;msb = 0 means positive;msb = 1 means negative. msb = 1 means negative.

For an unsigned 8 bit integer the range of represented numbers hFor an unsigned 8 bit integer the range of represented numbers has 256 positions, between 0 as 256 positions, between 0 and 255, in decimal.and 255, in decimal.For a signed 8 bit integer the range of represented numbers has For a signed 8 bit integer the range of represented numbers has also 256 positions, but also 256 positions, but between between --128 128 ÷÷ +127, assuming 0 a positive number. +127, assuming 0 a positive number.

Page 16: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

16

Conventions :Conventions :

Representation type + 5 - 5

“signed-magnitude” 00000101 10000101

“ones’ complement” 00000101 11111010

“two’s complement” 00000101 11111011

Rules:Rules:-- Positive numbers are identically represented.Positive numbers are identically represented.-- ““SignedSigned--magnitudemagnitude””: only the sign: only the sign--bit differs for negative numbers and positivebit differs for negative numbers and positive

numbers.numbers.-- ““OnesOnes’’ complementcomplement””: negative number magnitude is obtained by : negative number magnitude is obtained by complementingcomplementing everyevery

bit; the sign bit convention is preserved.bit; the sign bit convention is preserved.-- ““TwoTwo’’s complements complement””: negative number magnitude is obtained by : negative number magnitude is obtained by complementingcomplementing everyevery

bit and bit and addingadding 1 to lsb. 1 to lsb.

Page 17: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

17

““FlagsFlags””

““CarryCarry”” (C) which can occur between one binary rank and the superior on(C) which can occur between one binary rank and the superior one in arithmetic e in arithmetic operations (operations (““borrowborrow”” for subtraction). for subtraction).

““OverflowOverflow”” (O): depending if the sign exists: (O): depending if the sign exists:

O =O = CCmsbmsb oror CCmsbmsb--1 1 msbmsb

Signed number extension in twoSigned number extension in two’’s complement, 8 bit to 16 bit s complement, 8 bit to 16 bit

8 bit representation 16 bit representation

+ 1 00000001 0000000000000001

- 1 11111111 1111111111111111

Rules (extension from single to double precision):Rules (extension from single to double precision):-- The sign bit remains unchanged.The sign bit remains unchanged.-- The number magnitude will be the least significant half of the The number magnitude will be the least significant half of the extended number.extended number.-- The rest of the extended number will be filled with digits idenThe rest of the extended number will be filled with digits identical with the sign bittical with the sign bit

(0 for positive number and 1 for negative number. (0 for positive number and 1 for negative number.

Page 18: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

18

3) 3) ““Binary coded decimalBinary coded decimal”” (BCD)(BCD): each decimal digit is separately represented in natural binary: each decimal digit is separately represented in natural binarywith a with a nibblenibble. .

Microprocessors use two types of BCD representation:Microprocessors use two types of BCD representation:

-- ““Packed BCDPacked BCD””: two decimal digits are stored in a byte, one in every nibble. : two decimal digits are stored in a byte, one in every nibble. The The range of represented numbers has 100 positions: 0 range of represented numbers has 100 positions: 0 ÷÷ 99.99.

-- ““Unpacked BCDUnpacked BCD””: only one decimal digit stored in a byte in the least significa: only one decimal digit stored in a byte in the least significantntnibble. The other nibble is filled with 0. nibble. The other nibble is filled with 0.

4) 4) ““FixedFixed--pointpoint”” representation: a fixed, predefined number of binary digits arerepresentation: a fixed, predefined number of binary digits are used for the used for the integer part and decimal part of the number, respectively. integer part and decimal part of the number, respectively.

BCD or natural binary can be used. For the integer part the signBCD or natural binary can be used. For the integer part the signed integers representation is used ed integers representation is used and for the decimal part, the unsigned integers representation iand for the decimal part, the unsigned integers representation is used. (s used. (““trunctrunc”” or or ““roundround””). ).

Page 19: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

19

Rules:Rules:•• Every row of numbers has a header.Every row of numbers has a header.•• In the header the first number designates the total number of In the header the first number designates the total number of digits for every fixeddigits for every fixed--point point representation which follows.representation which follows.•• Next, the second number designates the number of decimals.Next, the second number designates the number of decimals.•• The row of digits follows (signed or not) with no other separaThe row of digits follows (signed or not) with no other separator between the fixedtor between the fixed--point point representations.representations.

Example: fixed point BCD representation:Example: fixed point BCD representation:

0100 0010 0000 1001 0110 0001 01010100 0010 0000 1001 0110 0001 0101 ........

the first number in the row is + 96.15 . the first number in the row is + 96.15 .

Page 20: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

20

5) 5) ““FloatingFloating--pointpoint”” representation representation

Two parts: Two parts: ““mantissamantissa”” MM (a normalized number) (a normalized number) and and ““exponentexponent”” EXPEXP::

binary numberbinary number = = M * 2 M * 2 EXPEXP

22--11 ≤≤ M M << 2200

Example:Example:bb3131......b......b2424bb2323.......................b.......................b00 ,,

where:where: -- bb3131 ÷÷ bb2424 is the exponent, the sign is bitis the exponent, the sign is bit bb3131-- bb2323 ÷÷ bb00 is the mantissa, the sign is bitis the mantissa, the sign is bit bb2323..

The range of represented numbers is:The range of represented numbers is: M * 2 M * 2 ±±128128

Page 21: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

21

Arithmetic coprocessors data representationArithmetic coprocessors data representation

Format

adr n+9

adr n+8

adr n+7

adr n+6

adr n+5

adr n+4

adr n+3

adr n+2

adr n+1

adr n

Byte 10 Byte 9 Byte 8 Byte 7 Byte 6 Byte 5 Byte 4 Byte 3 Byte 2 Byte 1

7 0

7 0

7 0

7 0

7 0

7 0

7 0

7 0

7 0

7 0

15 0

Word I15 I0

31 0

Short integer I31 I0

63 0

Long integer I63 I0

Packed BCD S d17 d16 d15 d14 d13 d12 d11 d10 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0

31 30 22 0

Short real S E7 Exp. M1 Mantissa M23

63 6 52 51 0

Long real S E10 Exp. M1 Mantissa M52

79 78 64 63 0

Temporary real S E14 Exp. E0 M0 Mantissa M63

Page 22: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

22

Format Range Precision Interpretation Word 104 16 bits I15… I0 Short integer 109 32 bits I31… I0 Long integer 1018 64 bits I63… I0 Packed BCD ±10± 18 18 digits (-1)S (d17… d0) Short real ±10± 38 24 bits (-1)S (2Exp-127)(M0.M1 … M23), M0 by default 1 Long real ±10± 308 53 bits (-1)S (2Exp-1023)(M0.M1 … M52), M0 by default 1Temporary real ±10± 4932 64 bits (-1)S (2Exp-16383)(M0.M1 … M63)

Page 23: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

23

c) Alphanumerical data c) Alphanumerical data

Any character on a computer keyboard.Any character on a computer keyboard.

““Character setCharacter set””: minimal number of symbols for text editing. : minimal number of symbols for text editing.

Each character will be represented by a binary code. Each character will be represented by a binary code.

““ASCIIASCII”” ((““American Standard Code for Information InterchangeAmerican Standard Code for Information Interchange””) standard:) standard:-- 26 capitals of the Latin alphabet;26 capitals of the Latin alphabet;-- 26 lower case characters;26 lower case characters;-- 10 figures:10 figures: 00 ÷÷ 99;;-- 20 additional symbols: + 20 additional symbols: + -- ( ) [ ] { } * # $ etc. ( ) [ ] { } * # $ etc.

Page 24: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

24

7 bit codes; 7 bit codes; in a byte, msb could be the in a byte, msb could be the ““parity bitparity bit””::

msb = 0msb = 0 if the character has an even number of binary digits 1;if the character has an even number of binary digits 1;

msb = 1 msb = 1 if the character has an odd number of binary digits 1.if the character has an odd number of binary digits 1.

Example: Example: A = 01000001A = 01000001;;B = 01000010B = 01000010;;C = 11000011C = 11000011 etc.etc.

Parity bitParity bit →→ a dedicated flag (a dedicated flag (PP). ).

Page 25: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

25

1.3.2 External representation 1.3.2 External representation

External representation: how the processed information inside thExternal representation: how the processed information inside the microcomputer is available to e microcomputer is available to the user. the user.

a) Instruction codes: suggestive abbreviations, which are keya) Instruction codes: suggestive abbreviations, which are key--words in the assembly language: words in the assembly language: ““mnemonicsmnemonics””. .

b) Numbers: several representations:b) Numbers: several representations:•• BinaryBinary representation, such is the content of the memory locations. representation, such is the content of the memory locations. •• OctalOctal representation: three bits are combined in a group.representation: three bits are combined in a group.•• HexadecimalHexadecimal representation: four bits (a nibble) are combined in a group. representation: four bits (a nibble) are combined in a group. With four bits, it is possible to represent 16 different digits;With four bits, it is possible to represent 16 different digits; in addition to the in addition to the normal digits 0 normal digits 0 ÷÷ 9 the letters A 9 the letters A ÷÷ F are generally used. The letter H (or h) is F are generally used. The letter H (or h) is positioned after the number to designate a hexadecimal number (fpositioned after the number to designate a hexadecimal number (for example 1199H). or example 1199H).

c) Characters: just the symbols for each one. Automatic conversc) Characters: just the symbols for each one. Automatic conversion ASCII code ion ASCII code →→ character character symbol. symbol.

Page 26: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

26

1.4. 1.4. Conventions Conventions

1. Unspecified entities :1. Unspecified entities :

rr some register;some register;r8r8 8 bit register;8 bit register;r16r16 16 bit register; 16 bit register; rrii ,, rrjj two different registertwo different register;;

memmem some memory location (or several successive locations); some memory location (or several successive locations); mem8mem8 8 bit8 bit memory location; memory location; mem16 mem16 16 bit16 bit memory location (could be two successive locations if the memorymemory location (could be two successive locations if the memory format isformat is

one byte); one byte); mem32 mem32 32 bit32 bit memory location (could be four successive locations if the memormemory location (could be four successive locations if the memory format isy format is

one byte);one byte);memmemii a memory location in order to be compared with another one; a memory location in order to be compared with another one;

Page 27: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

27

adradr some address; some address; adr16adr16 16 bit address16 bit address; ; adr24adr24 24 bit address24 bit address; ; adradrii an address location in order to be compared with another one; an address location in order to be compared with another one;

(r)(r) content of some registercontent of some register; ; ((rrii,, rrjj)) content of two concatenated registers; content of two concatenated registers; (r)(r)ll content of the lower half (content of the lower half (lsls) of a register; ) of a register; (r)(r)hh content of the upper half (ms) of a register; content of the upper half (ms) of a register; ((r))((r)) content of a memory location which address is in a register;content of a memory location which address is in a register;

((indirect addressingindirect addressing); ); ((memmem)) content of some memory location; content of some memory location;

adradrll the lower half of an address; the lower half of an address; adradrhh the upper half of an address; the upper half of an address; datadata some some operand; operand; data8data8 8 bit8 bit operand; operand; data16data16 16 bit operand; 16 bit operand; disp8disp8 8 bit displacement; 8 bit displacement; disp16 disp16 16 bit displacement; 16 bit displacement; portport some I/O portsome I/O port; ;

Page 28: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

28

2. Specified entities: 2. Specified entities:

R1, R2, A, AX, BP, A6,R1, R2, A, AX, BP, A6, DnDn, An, An register names; register names;

(R1)(R1) register register R1R1content; content; (R1, R2)(R1, R2) register pairregister pair R1R1,, R2R2 content;content;((R1))((R1)) content of the memory location whichcontent of the memory location which

address is in register address is in register R1R1; ;

MEM, MEM1MEM, MEM1 memory location names; memory location names; ADR,ADR, ADRn ADRn address namesaddress names. .

Page 29: 1.1. Microcomputer Functional Blocks - derivat.roderivat.ro/cursuri/electronica/an2/an2_derivat.ro_arhitectura... · Microcomputer Functional Blocks The Microcomputer as a “VON

© Microprocessor Architecture § 1 Corneliu BURILEANU

29

3. Operators: 3. Operators:

←← assignment; assignment;

↕↕ ↑↑ concatenation; concatenation; notnot onesones’’ complement; complement; ∀∀ logical OR; logical OR; && logical AND; logical AND; ⊕⊕ logical EXCLUSIVE OR; logical EXCLUSIVE OR; ++ addition; addition; -- subtraction; subtraction; ∗∗ multiplication; multiplication; DIVDIV division division -- integers; integers; MODMOD remainder.remainder.

4. Other symbols: 4. Other symbols:

[ ][ ] optional entities; optional entities; || alternative entities. alternative entities.