0% found this document useful (0 votes)
3 views

B_Ch2_EMI

Uploaded by

misours77
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

B_Ch2_EMI

Uploaded by

misours77
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Core – Compulsory B Chapter 2 Computer Hardware

System Unit (Core B, p.52-54, 67-68)

 A system unit

The following table shows some brief information on the components of a system unit.

Components Function

Motherboard Serves as a platform to connect all the components of a computer.

Executes instructions of computer programs.


Central Processing Unit
Performs arithmetic and logical operations.

Stores data and instructions that the CPU will execute.


Main memory (Primary storage)

Secondary storage Stores data for future use.

Power supply unit Provides power to a computer for operation.

 Motherboard

PCIe slot (Graphics card / sound card/ network card)

ROM chip CPU and cooling fan

SATA (Secondary storage)


RAM and RAM slot

9
 Central Processing Unit (CPU)

o Measurement of CPU Speed

 Clock rate / Clock frequency (Unit: GHz):


 An instruction may require several clock cycle to complete. Clock rate is
the number of clock cycles undergo in one second.

 Number of cores:
 Number of interconnected CPU cores working together to execute
different tasks at the same time.

o e.g.: 8/16 cores/threads in Intel i7

 Word length / word size

 The number of bits processed by a CPU each time.

 e.g.: 32-bit, 64-bit

 Think About It 

How to increase the performance of a CPU by design if its word length is fixed?
1. Increase the number of core, such as Dual core(2) / Quad core(4) / Hex core(6) / Octa core(8)
to support parallel computing.
2. Specialized CPU to complete certain tasks, in order to share the workload from general
purpose CPU.

A computer with 32-bit word length CPU (and system bus width) can only supports
up to 4GB of RAM memory address but unlimited hard disk memory size.

MISCONCEPTION  A 64-bit processor is twice as efficient as a 32-bit processor.

GPU refers to graphics processing unit.


It is a specialized electronic circuit designed to rapidly process video and 3D
rendering. It is usually installed on the graphics card.

10
Central Processing Unit (CPU) (Core B, p.63-70)

Components of CPU Function

Fetches instruction from the main memory.

Control Unit (CU) Interprets the instruction

Instructs the ALU how to perform an operation.

Perform arithmetic and logical operations

Arithmetic operations includes addition, subtraction,


Arithmetic and Logic Unit
multiplication and division.
(ALU)
Logical operations includes AND, OR, NOT etc.

Results usually stored in a register called accumulator

Registers Memory units inside a CPU

Temporarily stores the data or instructions that are expected to


Caches be accessed most frequently.

The program that a CPU runs

High-level programming languages

 Easy to read and write by human


 machine independent

Assembly languages

 Still can be read but harder to be


understood by human
 Machine dependent
Machine code

 Cannot be understood by human


 Machine dependent

11
Structure of a CPU

General Purpose Registers (GPRs)


AX Accumulator

BX Base Register

CX Counter

DX Data Register

Control Registers

Current Instruction register: contains the instructions to be executed by the CPU.


CIR

Program counter: contains the memory address of the next instruction to be


PC
executed.

Memory address register: holds the memory address of the memory


MAR location to which data is to be transferred to or
from.

Memory data register: contains the data to be written into or read from the
MDR
location specified in MAR.

Status register: contains a number of flag bits indicating the status after the

SR execution of instructions.

12
Status register

 Think About It 

The following figure illustrates the original status of a SR in CPU.

It is known that the instruction SUB X, Y calculates the result X - Y and then stores the result to the
register AX.

Explain the purpose of each instruction, and predict how the flags will be changed after execution of each
instruction.

1. SUB 1, 5
Description: Calculates the result 1 – 5 and then stores the result (-4) to the register AX

0 1 0 0

2. SUB AX, AX
Description: Calculates the result AX – AX and then stores the result (0) to the register AX

1 0 0 0

13
Machine Cycle (Core B, p.65-67)

It is the process of executing an instruction in a CPU. It includes the following sub-cycles.

Sub-cycle Description

Fetch Read the next instruction from the main memory into instruction
register (IR).

Decode Identify the operation code and operands in an instruction.

Execute Interpret the operation code and perform the required operation.

Interrupt Sub-cycle

At the end of the execution of an instruction, the CPU detects whether an interrupt has occurred.

14
Example of a machine cycle

Memory address of instruction Instruction Explanation

10000 LOAD AX, 8 Store 8 in register AX

Step 1: Fetch instruction

10000

LOAD AX, 8 10000


10000

LOAD AX, 8

Step 2: Increment PC

10001

15
Step 3: Decode instruction

Step 4: Execute Instruction

Self Learning Video


CPU Operation

https://youtu.be/MmQdg_QEM8w

16
Storage device (Core B, p.70-80)

CPU Main Memory Secondary


 Cache Memory
 Memory
(with registers) (RAM and ROM)
(e.g. hard disk)

Fast Slow Access speed

Small Large Storage size


o Storage capacity

 Think About It 

2011 HKCEE Paper1A (60% of candidates got it correct)

John has 12 video clips with each size 1 GB stored in a hard disk. He wants to directly store
the clips into regular singled-sided DVD-Rs (4.2 GB) for backup purpose. What is the
minimum number of DVD-Rs required?

The size of each regular singled-sided DVD-Rs is 4.2 GB, so we can store 4 videos on each of the
DVD-Rs.

In conclusion, we need 3 regular singled-sided DVD-Rs to store all the video clips.

17
o Main memory (RAM and ROM)

 Comparing RAM and ROM

Random access memory (RAM) Read-only memory (ROM)

Volatile Non-volatile
Volatile Data removed when the computer is out Data does not disappear after turning off
of power. the computer.

Temporarily hold the currently use data


Stores bootstrap program to load the OS
Purpose and instructions of application software
when the computer starts up.
and operating system.

Dynamic random access memory (DRAM): Erasable programmable read-only


 Lower cost memory (EPROM):
 Higher power consumption  Use UV light to erase data
 Smaller storage capacity
Type
Static random access memory (SRAM): Electrically erasable programmable read-
 Higher cost only memory (EEPROM):
 Lower power consumption  Use electrical signal to erase data
 Larger storage capacity

o Secondary storage
 Speed of a Secondary Storage Device
 Access time
The average time taken for the device to search and read the required
data on the storage medium.
e.g. 8 ms (where 1ms = 0.001s)
 Data transfer rate
The amount of data that can be transferred between main memory and
a storage device per second.
e.g. 111.4 MBps (where M = 220, B = 8 bit)
 Types of Secondary Storage Devices
 Magnetic Storage Devices
1. Magnetic tapes
 Data access mode: sequential access
 Large storage size, usually used for backup purpose
2. Hard disk
 Data access mode: direct access
 Factors effecting access speed
o Seek time
o Drive rotational speed (unit: rpm)

18
 Solid-state storage

Data access mode: direct access

1. Solid-state drive (SSD)


 Does not contain any moving parts
 Shock resistance  Durable and portable
 Higher price
2. Memory card
 Advantage: small in size and light (portable), rewritable,
quiet, low power consumption
 Usually used in digital camera, digital video camera or
mobile devices etc.
 e.g.: SD card
3. Flash memory
 A kind of EEPROM
 Advantages: Small in size and light, quiet, low power
consumption, fast device, booting up speed
 Disadvantages: Limited storage size and expensive
 Usually acts as the secondary storage of mobile devices
4. USB flash drive
 A kind of Flash memory
 Advantage: small in size and light (portable), rewritable
 Optical storage
1. CD
 Storage: about 750 MB
 Common types of CD: CD-ROM, CD-R and CD-RW
2. DVD
 Storage: about 17 GB
 Common type: DVD+R, DVD-R, DVD+RW, DVD-RW and
DVD-RAM
3. Blue-ray Disc
 Storage: 25 GB for single layer, 50 GB for dual layer

Redundant array of independent disks (RAID)

 Consists of multiple storage devices, for improving data transfer rate, reduce data
loss and recover loss data

19
Comparison of HDD and SSD

Traditional hard disk (HDD) Solid-state disk (SSD)

Appearance

Technology Magnetic storage Semiconductor memory


Shock Resistance Low High
Data transfer rate Slow Fast

Storage Capacity Larger Less

Noise Noisy Quiet


Connection
ATA, SATA, SCSI, USB SATA, USB
Interface

Comparison of Local Hard disk and Network attached storage (NAS) / Cloud storage
Store in local
NAS
computer
Google drive C:\
Example
NAS installed on school server D:\

Network connection required Yes No

High data transfer speed of


Yes No
network required

Centralized data management


(Easy for backup data and Yes No
security control)

Data may be intercepted


Yes No
during data transmission

 Think About It 
2019 HKDSE Paper1A (38% of candidates got it correct)
Arrange the following in ascending order by data transfer rate.
(1) Solid State Drive (SSD)
(2) Memory cache
(3) RAM

(1) < (3) < (2)

20
Bus (Core B, p.58-60)
 System bus

Bus Type Direction Function

Indicate the direction of the data transfer and coordinate the timing
Control bus One-way of the event during transfer.

Data bus Transfer data and instructions.


Two-way

Address bus Transfer the source address or the destination address of data.
One-way

 Universal serial bus (USB)

21
Core – Compulsory B Chapter 2 Computer Hardware (Glossary)

English 中文 English 中文

1 Motherboard 主機板 22 Zero flag 零標記

2 Hard disk 硬碟 23 Sign flag 符號標記

3 External hard disk 外置硬碟 24 Parity flag 奇偶標記

4 USB flash drive USB 快閃儲存器 25 Carry flag 進位標記

5 Control Unit (CU) 控制部件 26 Overflow flag 溢出標記

6 Arithmetic and Logic Unit (ALU) 算術及邏輯運算部件 27 Bus width 總線寬度

7 Registers 寄存器 28 Fetch 讀取

8 Accumulator AX) 累加器 29 Decode 解碼

9 Assembly languages 匯編語言 30 Execute 執行

10 Machine code 機器碼 31 Interrupt 中斷

11 Machine dependent 機器依賴性的 32 Address bus 位址總線

12 Program counter (PC) 程序計數器 33 Control bus 控制總線

13 Current Instruction register (IR) 指令寄存器 34 Bus width 總線寬度

14 Memory address register (MAR) 記憶體位址寄存器 35 Word length 字長

15 Memory data register (MDR) 記憶體數據寄存器 36 Dual core 雙核心

16 Instruction decoder 指令解譯器 37 Quad core 四核心

17 Status register (SR) 狀態寄存器 38 Main memory 主記憶體

18 Clock rate / Clock frequency 時鐘頻率 39 Volatile 易失性

19 Graphical processing unit (GPU) 圖像處理器 40 Bootstrap program 開機程式

20 Random access memory (RAM) 隨機存取記憶體 41 Cache memory 快取記憶體

21 Read-only memory (ROM) 唯讀記憶體

22
Core – Compulsory B Chapter 2 Computer Hardware (Glossary)

English 中文

42 Secondary storage device 輔助存貯設備

43 Backing storage 備份存貯器

44 Access time 存取時間

45 Data transfer rate 數據傳輸速度

46 Magnetic storage device 磁存貯設備

47 Optical storage device 光存貯設備

48 Memory card 記憶卡

49 USB flash drive / USB thumb drive USB 快閃貯存器

50 Direct access 直接存取

51 Seek time 查找時間

52 Drive rotational speed 硬碟旋轉速度

53 Contiguous 連續的

54 Magnetic tape 磁帶

55 Sequential access 順序存取

56 Network storage (NAS) 網絡存貯器

23

You might also like