Fundamental of Computer

49
1 Fundamental of Computer Suthida Chaichomchuen : SCC [email protected]

description

Fundamental of Computer. Suthida Chaichomchuen : SCC [email protected]. Computer Components. Hardware (architecture) Software (instruction set). Basic Hardware. Bits Bytes Registers Memory Processor Data Bus. Hardware Components. Internal hardware Microprocessor Memory Registers - PowerPoint PPT Presentation

Transcript of Fundamental of Computer

Page 1: Fundamental of Computer

1

Fundamental of Computer

Suthida Chaichomchuen : [email protected]

Page 2: Fundamental of Computer

2

Computer Components

Hardware (architecture) Software (instruction set)

Page 3: Fundamental of Computer

3

Basic Hardware

Bits Bytes Registers Memory Processor Data Bus

Page 4: Fundamental of Computer

4

Hardware Components

Internal hardware– Microprocessor– Memory– Registers

External hardware– Input/Output Devices

Page 5: Fundamental of Computer

5

Software Organization

Programs Data files Operating System

Page 6: Fundamental of Computer

6

Computer storage

Bit– On : 1– Off : 0

Byte– data : 8 bits– parity : 1 bit (automatically setting)

Page 7: Fundamental of Computer

7

Related bytes

Word Doubleword Quadword Paragraph Kilobyte Megabyte

Page 8: Fundamental of Computer

8

Binary numbers

Bit value : 1 1 1 1 1 1 1 1Position value : 128 64 32 16 8 4 2 1Bit number : 7 6 5 4 3 2 1 0

Page 9: Fundamental of Computer

9

Binary arithmetic

Decimal Binary 65 01000001 +42 +00101010 107 01101011

Decimal Binary 60 00111100 +53 +00110101 113 01110001

Page 10: Fundamental of Computer

10

Negative Binary Numbers

Number +65 : 01000001Reverse the bits : 10111110Add 1 : 1Number -65 : 10111111

Reverse the bit value and add 1

Page 11: Fundamental of Computer

11

Hexadecimal Representation

Binary : 1011 1001 1100 1110Decimal : 11 9 12 14Hexadecimal : B 9 C E

Page 12: Fundamental of Computer

12

System Unit

A system board– Microprocessor– ROM– RAM

Power supply Expansion slots

Page 13: Fundamental of Computer

13

Processors (Intel family)

8088/80188 8086/80186 80286 80386 80486 Pentium (or 80586) PentiumPro (or 6x86)

Page 14: Fundamental of Computer

14

Processors : 8088/80188

16-bit registers 8-bit data bus address up to 1 million bytes of memory registers process 2 bytes/time data bus transfer 1 byte/time operate in real mode

Page 15: Fundamental of Computer

15

Processors : 8086/80186

16-bit registers 16-bit data bus & run faster address up to 1 million bytes of memory registers process 2 bytes/time data bus transfer 2 bytes/time operate in real mode

Page 16: Fundamental of Computer

16

Processors : 80286

16-bit registers 16-bit data bus & run faster address up to 16 million bytes of memory operate in real mode or protected mode

Page 17: Fundamental of Computer

17

Processors : 80386

32-bit registers 32-bit data bus address up to 4 billion bytes of memory operate in real mode or protected mode

Page 18: Fundamental of Computer

18

Processors : 80486

32-bit registers 32-bit data bus address up to 4 billion bytes of memory operate in real mode or protected mode processor is designed for enhanced

performance

Page 19: Fundamental of Computer

19

Processors : Pentium (or 80586)

32-bit registers 64-bit data bus execute more than one instruction/clock

cycle

Page 20: Fundamental of Computer

20

Processors : PentiumPro (or 80686)

advances the capacity of registers and the data bus– connected to a build-in storage cache by

a 64-bit wide bus

Page 21: Fundamental of Computer

21

Logical Units in Processor

Bus Interface Unit <BIU> – Manage the bus control unit, segment

registers and instruction queue.– Provide access to instructions.

Execution Unit <EU>– Execute instructions and get data that

the BIU delivered.

Page 22: Fundamental of Computer

22

Internal Memory

ROM (Read Only Memory) RAM (Random Access Memory)

Page 23: Fundamental of Computer

23

Map of Base Memory

64K base system ROM

192K memory expansionarea (ROM)

640K memory (RAM) conventional memory

upper memory

128K video display area (RAM)

Start Address

Dec Hex960K F0000

768K C0000

640K A0000

zero 00000

Purpose

Page 24: Fundamental of Computer

24

Addressing data in memory

System stores the data in memory in reverse-byte sequence :– low-order byte : low memory address– high-order byte : high memory address

Page 25: Fundamental of Computer

25

memory

Address 7613most significant byte

register 05 29

29 05

Address 7612least significant byte

Addressing data in memory

Page 26: Fundamental of Computer

26

Segments

A segment is a special area defined in a program that begins on a paragraph boundary, that is, at a location evenly divisible by 16, or hex 10.

Page 27: Fundamental of Computer

27

Main Segments

Code Segment <CS>– contains the machine instructions that

are to execute Data Segment <DS>

– contains a program’s defined data, constants, and work areas.

Page 28: Fundamental of Computer

28

Main Segments . . .

Stack Segment <SS>– contains any data and addresses that

you need to save temporarily or for use by your own “called” subroutines.

Page 29: Fundamental of Computer

29

Segment Boundaries

Stack Segment

Data SegmentCode Segment

Memory

Relocatable in memory

Address

Address

Address

SS

DS

CSSegmentRegisters

Page 30: Fundamental of Computer

30

Segment Offsets

Offset is the distance in bytes from the segment address to another location within the segment.

A 2-byte offset can range from 0000H - FFFFH (0-65,535).

Memory location = segment address + offset value

Page 31: Fundamental of Computer

31

Offset 32H

X

Segment address 038E0H

X. . .

DS segment address : 038E0HOffset : +0032HActual address : 03912H

Segment Offsets

Page 32: Fundamental of Computer

32

Addressing Capacity

8086/8088 Addressing– 16 bits for addressing

80286 Addressing– 24 bits for addressing

80386/486/Pentium Addressing– In protected mode use 48 bits for

addressing

Page 33: Fundamental of Computer

33

Registers

The processor’s registers are used to control instructions being executed, to handle addressing of memory, and to provide arithmetic capability.

Page 34: Fundamental of Computer

34

Registers

Segment Registers Pointer Registers General-Purpose Registers Index Registers Flags Register

Page 35: Fundamental of Computer

35

Segment Registers

CS register– Contains the starting address of a

program’s code segment. DS register

– Contains the starting address of a program’s data segment.

Page 36: Fundamental of Computer

36

Segment Registers . . .

SS register– The system stores the starting address

of a program’s stack segment in the SS register.

ES register– Used by some string operations to

handle memory addressing.

Page 37: Fundamental of Computer

37

Segment Registers . . .

FS and GS register– Additional extra segment registers on

the 80386 and later processors.

Page 38: Fundamental of Computer

38

Pointer Registers

Instruction Pointer (IP) register– Contains the offset address of the next

instruction that is to execute.– IP indicates the current instruction within

the currently executing code segment.

Page 39: Fundamental of Computer

39

Pointer Registers . . .

Stack Pointer (SP) register– Refers to the current word being

processed in the stack. Base Pointer (BP) register

– Facilitates referencing parameters.

Page 40: Fundamental of Computer

40

General-Purpose Registers

AX register : Accumulator– Used for operations involving input/outp

ut and most arithmetic.

EAX:

AX: AH AL

Page 41: Fundamental of Computer

41

General-Purpose Registers

BX register : Base register– Used as an index to extend addressing.

EBX:

BX: BH BL

Page 42: Fundamental of Computer

42

General-Purpose Registers . . .

CX register : Count register– Contains a value to control the number

of times a loop is repeated.– Contains a value to shift bits left or right.

ECX:

CX: CH CL

Page 43: Fundamental of Computer

43

General-Purpose Registers . . .

EDX:

DX: DH DL

DX register : Data register– Used for input/output operations– Used for multiply and divide operations

that involve large values.

Page 44: Fundamental of Computer

44

Index Registers

SI register– source index register is required for some

string operations– SI is associates with DS register

DI register– destination index register is required for

some string operations– DI is associates with ES register

Page 45: Fundamental of Computer

45

Flags Register

Flag: O D I T S Z A P C

Bit no.: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Page 46: Fundamental of Computer

46

Flags Register

OF (overflow)– Indicates overflow of a high-order bit

following arithmetic. DF (direction)

– Determines left or right direction for moving or comparing string data.

IF (interrupt)– Indicates that all external interrupts are to

be processed or ignored.

Page 47: Fundamental of Computer

47

Flags Register . . .

TF (trap)– Permits operation of the processor in

single-step mode. SF (sign)

– Contains the resulting sign of an arithmetic operation.

– 0 : positive / 1 : negative

Page 48: Fundamental of Computer

48

Flags Register . . .

ZF (zero)– Indicates the result of an arithmetic or

comparison operation.– 0 : nonzero / 1 : zero

AF (auxiliary carry)– Contains a carry out of bit 3 on 8-bit

data, for specialized arithmetic.

Page 49: Fundamental of Computer

49

Flags Register . . .

PF (parity)– Indicates even or odd parity of a low-

order 8-bit data operation. CF (carry)

– Contains carries from a high-order bit following an arithmetic operation.

– Contains the contents of the last bit of a shift or rotate operation.