Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

‫معمارية وتنظيم الحاسوب‬

‫د‪ .‬محمود القباطً‬

‫‪1‬‬
‫الموضوع‬ ‫م‬

‫مقدمة في معمارية الحواسيب‬ ‫‪1‬‬

‫نموذج ‪ – IAS‬الفرق بين معمارية فون نيومن ومعمارية هارفرد‬ ‫‪2‬‬

‫مكونات وحدة المعالجة المركزية‪ -‬المسجالت‬ ‫‪3‬‬

‫الذاكرة ‪ +‬البنية الموسعة للحاسوب ‪IAS‬‬


‫‪4‬‬
‫النقل بين المسجالت والذاكرة (‪)Register Transfer & Memory transfer Micro-operations‬‬
‫‪5‬‬

‫‪Arithmetic Micro-operations‬‬
‫‪6‬‬

‫‪Mid-term exam‬‬
‫‪7‬‬

‫‪Logic and Shift Micro-operations‬‬


‫‪8‬‬

‫‪Design of a simple computer‬‬


‫‪9‬‬

‫البنية الداخلية للمعالج ‪8086‬‬ ‫‪10‬‬


‫البرمجة بلغة التجميع‬ ‫‪11‬‬
‫‪Review‬‬ ‫‪12‬‬
‫النقل بين المسجالت والذاكزة‬
Register Transfer & Memory transfer
Micro-operations

‫ محمود القباطي‬.‫د‬

3
4
5
Figure 6.1
6
‫مراحل تنفيذ التعليمة‬
‫مراحل تنفيذ التعليمة ‪ٌ :‬تم تنفٌذ كل تعلٌمة فً المعالج على عدة مراحل ‪:‬‬
‫جلب التعليمة ‪ :‬وٌتم فٌها قراءة التعلٌمة التالٌة من الذاكرة إلى مسجل التعلٌمة‬
‫تفسير التعليمة ‪ :‬وهً مهمة تحدٌد العلمٌة التً تمثلها التعلٌمة الموجودة فً‬
‫مسجل التعلٌمة‬
‫جلب المعامالت ‪ :‬وهً مهمة نقل معامالت التعلٌمة ان وجدت الى‬
‫المسجالت المناسبة‬
‫تنفيذ التعليمة ‪ :‬وهً مهمة إجراء العملٌة على المعامالت ضمن وحدة‬
‫الحساب والمنطق وتخزٌن النتٌجة فً المسجل المناسب‬
‫تخزين النتائج ‪ :‬وهً مهمة كتابة مسجل النتٌجة فً الذاكرة‬

‫‪7‬‬
‫مراحل ‪ Pipelining‬التواردية‬
‫‪: Pipelining‬هً طرٌقة لزٌادة معدل تنفٌذ التعلٌمات فً المعالج ‪ ,‬فعوضا عن االنتظار‬
‫حتى إنهاء المراحل الخمسة لتنفٌذ التعلٌمة ثم البدء بتنفٌذ التعلٌمة التالٌة ‪ٌ ,‬مكن تخصٌص‬
‫وحدة عتادٌة لتنفٌذ كل مرحلة من المراحل حٌث تقوم الوحدة األولى بجلب التعلٌمة‬
‫وتسلٌمها لوحدة التفسٌر‪ .‬فً الوقت الذي تقوم فٌه وحدة التفسٌر بتفسٌر التعلٌمة األولى‬
‫تقوم وحدة الجلب بجلب التعلٌمة الثانٌة وهكذا ‪ ,‬تسمى طرٌقة التنظٌم هذه لتنفٌذ التعلٌمات‬
‫بالتواردٌة (‪ . )Pipelining‬فإذا كان تنفٌذ كل مرحلة بتطلب زمنا دورة ساعة واحدة فان‬
‫زمن تنفٌذ كل تعلٌمة ال ٌزال مساوٌا ‪ 5‬نبضات ساعة‪ ,‬ولكن هنا نأخذ تعلٌمة جدٌدة عند‬
‫كل نبضة ساعة وبالتالً ٌكون معدل تنفٌذ التعلٌمات هو تعلٌمة واحدة فً كل نبضة ساعة‬
‫بدال عن تعلٌمة فً كل ‪ 5‬نبضات ساعة‪.‬‬

‫‪Sequential processing‬‬
‫‪Pipelining processing‬‬ ‫‪8‬‬
‫مراحل ‪ Pipelining‬التواردية‬

‫لكي تعمل طريقة التواردية (‪ )Pipelining‬بشكل صحيح ‪ ,‬ال بد أن يكون زمن تنفيذ‬
‫المراحل المختلفة متساويا‬

‫إضافة إلى ذلك تشكل عملية القفز مشكلة بالنسبة للتواردية اذ ال نعلم بعملٌة القفز اال عند‬
‫الوصول إلى مرحلة التنفٌذ‪ ,‬فً هذا الوقت تكون التعلٌمة التالٌة لتعلٌمة القفز قد دخلت فً‬
‫خط التواردٌة وبالتالً ٌجب تجاهل هذه التعلٌمات والبدأ من جدٌد بجلب التعلٌمة من‬
‫المكان الجدٌد الذي سٌقفز الٌه البرنامج‪.‬‬

‫‪9‬‬
Micro-operations
• The microoperations most often encountered
in digital computers are classified into four
categories:
– Register transfer micro-operations
– Arithmetic micro-operations (on numeric data
stored in the registers)
– Logic micro-operations (bit manipulations on non-
numeric data)
– Shift micro-operations
cpe 252: Computer Organization 10
Register Transfer and Micro-operations

11
Register Transfer and Micro-operations

12
Register Transfer and Micro-operations

13
Register Transfer and Micro-operations

14
Register Transfer and Micro-operations

15
‫‪Register Transfer‬‬
‫‪R2‬‬
‫‪70‬‬ ‫‪Clock‬‬

‫‪n‬‬
‫‪R1‬‬
‫‪20‬‬

‫‪Hardware implementation of a register transfer Micro-operations: R2 ← R1‬‬


‫النقل بين مسجلين بدون تحكم‪ :‬عند حدوث أول نبضة تزامن ٌتم تنفٌذ هذه‬
‫التعلٌمة (‪ )R2 ← R1‬حٌث ٌتم نسخ محتوى المسجل ‪ R1‬إلى المسجل ‪ R2‬وال‬
‫تتغٌر القٌمة الموجودة فً ‪ R1‬كما هو موضح بالشكل التالً‪:‬‬
‫‪R2‬‬
‫‪20‬‬ ‫‪Clock‬‬ ‫‪t‬‬ ‫‪t+1‬‬

‫‪R2 ← R1‬‬ ‫‪n‬‬


‫‪R1‬‬
‫‪20‬‬
‫‪16‬‬
Register Transfer
Hardware implementation of a controlled transfer: P: R2 ← R1
R2
Control P=0 Load
70 Clock
Circuit
P: R2 ← R1
n
R1
20

R2 ‫ إلى المسجل‬R1 ‫) ال ٌتم نقل محتوى المسجل‬P=0( ‫ عندما تكون قٌمة‬: ‫االنتقال المتحكم به‬
R2
P: R2 ← R1 Control P=1 Load
20 Clock
Circuit

n
R1
20

R2 ‫ إلى المسجل‬R1 ‫) ٌتم نقل محتوى المسجل‬P=1( ‫ عندما تكون قٌمة‬: ‫االنتقال المتحكم به‬
17
Register Transfer and Micro-operations

18
Register Transfer and Micro-operations

19
Figure 6.3 20
Figure 6.4 Bus system for four Register

Example: Statement

Load Load Load Load

2x 4
Enable
Decoder

21
Bus system for four Register
Example: Consider the statement

Select source =00 (Muxs select register A)

Select destination =01 (Decoder selects register C)

Decoder enable =0 (Decoder is enabled)

22
Figure 6.4 Bus system for four Register

Example: Statement

Load Load Load Load

2x 4
Enable
Decoder

23
Bus system for four Register
Example: Consider the statement

Select source =10 (Muxs select register C)

Select destination = 11 (Decoder selects register A)

Decoder enable =0 (Decoder is enabled)

24
Multiplexer And BUS-based Transfers for multiple registers

25
Memory Transfer
)Address( ‫عناوين‬ )Data( ‫بيانات‬

x0C 19
MAR
Read/Write x0E
34 Read
‫مسجل عنوان الذاكرة‬
Address x10 45
x12 66 Write
MDR
Write x14 0
‫مسجل بٌانات الذاكرة‬ Data x16 13
x18 22
Read
Random access memory (RAM)

26
Memory Transfer: Read Micro-operations

MAR
x0C 19
x12 x0E 34
MDR x10 45
100 x12 66
x14 0
x16 13
MDR←M[MAR] x18 22
RAM

MDR MDR
100 66

27
Memory Transfer: Write Micro-operations

MAR
x18
MDR
66

M[MAR] ← MDR
x0C 19
x0C 19 x0E 34
x0E 34 x10 45
x10 45 x12 66
x12 66 x14 0
x14 0 x16 13
x16 13 x18 66
x18 22
RAM
RAM 28
Q1) Show the block diagram that executes the statement:

Q2) Show the block diagram that executes the following two statements:

Q3) Let be the selection variables for the multiplexer of Fig. 6.4, and let be the
selection variables for the destination decoder. Variable is used to enable the decoder.

a) State the transfer that occur when the selection variables are equal to:
(1) 00010 (2) 01000 (3) 11100 (4) 01101

b) Give the values of the selection variables for the following transfer:
(1)

(2)

(3) 29
30

You might also like