Computer Organization Assembly Language 1 Syllabus The Basic
Computer Organization & Assembly Language 1
Syllabus Ø Ø Ø The Basic Structure of Computers Number Representations Instruction Formats and Addressing Modes Assembly Language I/O Organization Computer Arithmetic Basic Processing Unit Memory Subsystem Design Cache memory Virtual memory Pipelining 3
Lecture 1 Introduction The Basic Structure of Computers. 4
Basic Functional Units 6
What is an instruction? Ø Instruction คอ คำสงทถก Main Memory เพอทจะนำไป Processor Ø Data คอ operand fetched มาจาก execute ภายใน Ø Example Add R 1, R 2 => Instruction Add => Operator R 1, R 2 => Operand 8
Concept of memory Ø Memory สามารถจดเรยงไดเปนรปแบบของลำดบขน ซงจะมความแตกตางกนในดานของ และขนาด(size) ความเรว (speed) Smaller size, faster access speed, and more expensive (Register, cache, RAM) Larger size, slower access speed, and cheaper (Disk, CD, Tape) 10
ALU (Arithmetic and Logic Unit) 13
Basic Operation Concepts Example Operation : Add LOCA, R 0 Ø Event (เหตการณ ) ทเกดขนจากคำสงดานบน Ø 1. 2. 3. 4. คำสง (instruction : Add) จะถก fetch จาก Main Memory Operand ใน location A (ใน main memory) จะถก fetch ไปยง Register Operand จะถกบวก (Add) เขาไปใน R 0 ผลลพธ (Result) จะถกเกบไวใน R 0 15
General Architecture of a Processor 17
General Architecture of a Processor IR (instruction register) : เกบคำสงปจจบน Ø PC (program counter) : เกบ memory address ของคำสงถดไป (next instruction) Ø MAR (memory address register) : เกบ address ของ Main memory ทจะเขาถง Ø MDR (memory data register) : เกบ data ทจะทำการสงไปยง Main memory หรอ รบมาจาก Main memory Ø General purpose registers : สำหรบเกบ ขอมล , operand หรอคำสงใด ๆ Ø 18
Performance Ø ประสทธภาพของ l l l Computer ขนอยกบ : Compiler : compiler สามารถแปล High level language statement ไปเปน Machine level language statement ไดเรวแคไหน Machine Instructions set : ในระบบคอมพวเตอรทตางกนกจะม Machine Instructions set ทตางกนดวย Hardware : ความเรวของ Processor และขนาดของ Memory 23
Performance Ø Elapsed time : คอเวลาทงหมดททำการ execute program (รวมทงหมด ทง processor speed, I/O speed, etc. ) Ø Processor time : ใชวดเฉพาะ processor time เทานน Ø จดประสงคเมอเราทำการ execute program คอ : l l Maximize processor time (ใชประโยชนจาก processor ใหไดมากทสด ) Minimize transfer time 24
Ø Clock : คอ Performance สญญาณทใชเพอใหจงหวะเวลากบ processor เพอใหการทำงานระหวางหนวยตาง เขาจงหวะกน ๆ Ø Given : l l P : ความยาวของ Clock cycle R = 1/P : number of clock cycles per second Cycles per second หรอ เฮรท (Hz) What is the speed of faster processor today? example 3 GHz = ������ execute 3000 million cycle/second 25
Basic Performance Equation Ø T = (N*S)/R Ø โดย l l T : Processor time สำหรบ execute ใน 1 program N : จำนวนของคำสง (instruction)ทถก execute ใน 1 program S : จำนวนของ clock cycle ททำการ execute ใน 1 คำสง (instruction) R : Clock rate 26
High Performance Ø การทำให Processor มประสทธภาพสงสด มคานอยทสด ) l l l (ทำให T Reduces N : โดยการใช Compiler ประสทธภาพสง Reduces S : ใช pipelining technique Increase R : Upgrade Hardware 27
- Slides: 27