Lecture 1

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 23

Computer Organization and

Assembly Language
Instructor: Asra Ashraf
[email protected]

Lecture 1

1
Outline

•Why to learn computer organization and


assembly language?
•Difference between Computer Organization
and Computer Architecture
•Low Level, High Level and Machine Languages
•Assembly Language Programming Tools

2
Course Information
• EE213 – Computer Organization and Assembly
Language (COAL)
• 3 + 1 Credit Hours
• 2 Lectures every week
• 3 hours of Lab work every week
• Pre Req. EE109 – CLD

3
Recommended Books
• Text Book(s)
– Assembly Language for x86 Processors by Kip R. Irvine
6th edition
– Computer Organization and Architecture by William
Stallings 9th edition
• Reference Book(s)
– Fundamentals of Computer Organization and
Architecture by Mostafa Abd- El- Barr
– Any other reference material will be provided through
slate
4
Marks Distribution

Quizzes (5 – 10) 10-15%


Sessional-I 15%
Sessional-II 15%
Assignments/Class Activities 5-10%
Final 50%
___________________________________
Total 100%

5
Attendance Policy
• In order to appear in final exam, 80% attendance is
must, and there will be zero tolerance on attendance
• Attendance will be called at the start of every class
and you will be marked as absent if you are more
than 10 minutes late
• Only excuses obtained officially are accepted.
Personal excuses are not accepted. No make-up
tests/quizzes/exams will be provided until instructed
by academic committee

6
General Guidelines
• Quizzes can be unannounced
• The environment of class will be friendly but
we have to respect the environment of the
class
• You are free to ask relevant questions during
the lecture
• Use of mobile phones/tablets/laptops is strictly
not allowed
• There will be no extension in the deadlines
7
Lets Start the Course

8
Why to Learn COAL?
• To Complete the Degree?
• There are many reasons and advantages to learn COAL
• Significance of Computer Organization
– How exactly each instruction is executed at the micro level
– Data flow
– Timing analysis
– Memory hierarchy
– Trade offs between execution cycles
– Hardware requirements/costs
– Software-hardware trade-offs
• All above are possible if you know about computer
organization

9
Why to Learn COAL?
• Significance of Assembly Language
– Accessibility to system hardware
• Assembly Language is useful for implementing system software
• Also useful for small embedded system applications

– Space and time efficiency


• Understanding sources of program inefficiency
• Tuning program performance
• Writing compact code

– Writing a compiler for a high-level language

10
Difference between Computer
Organization & Computer Architecture
• Computer Architecture
– Computer Architecture is abstract model and are
those attributes that are visible to programmer
like instructions set, no of bits used for data,
addressing techniques
• Computer Organization
– A computer's organization expresses the realization of the
architecture. OR how features are implemented like these
registers ,those data paths or this connection to memory.
Contents of CO are ALU, CPU and memory organizations
11
Difference between Computer
Organization & Computer Architecture

• Computer Architecture Computer Organization

•Deals with components of


• Interface between hardware
connection in a system
and software
•Expresses the realization of
• Abstract model and is architecture
programmer's view in terms •Describes how computer does a
of instructions, addressing task
modes and registers
•Organization is done on the basis
• While designing computer of architecture
system architecture is •Deals with low level design issues
considered first
• It deals with high level
design issues
12
A Hierarchy of Computer
Languages
• High Level Languages
• Assembly Language
• Machine Language

13
High Level Languages
• Called High Level because closer to human
language and farther from machine language
• Independent of a particular type of processor
• Easier to read, write and understand because
uses natural language elements
• Hides implementation details
• Must be translated to machine language
• C++, Jave, Python, Php etc
14
Assembly Language
• Low level programming language
• Used to interact with computer hardware
• Specific to a particular computer architecture
• Focuses on programming microprocessors
• Used to program
– Embedded system
– Device driver programming
– Computer viruses and boot loaders
15
Machine Language
• Lowest level programming language
• Sequence of 1s and 0s
• Easily understood by computers
• Almost impossible for humans to use
• Each CPU has its own unique machine
language

16
Low Level, High Level and Machine Languages

Application Programs

High-Level Languages High-Level Language


Machine independent

Machine specific
Low-Level Language
Assembly Language

Machine Language

Hardware

17
Conversion from High Level (HL) to
Low Level (LL) Language
• From Assembly to Machine
Language
– Assembler is used
• From High Level to Machine
Level Language
– Compiler converts High Level
Language to Object Code
– Assembler is used to convert
Assembly Language code to
Machine Code

18
Compiler and Assembler

19
Translation Between Computer
Languages
• Add 2 and 4 and store the result in a variable “a”

High Level
Language

Assembly
Language

Machine
Language
20
Advantages of High Level Languages
• Program development is faster
– High-level statements: fewer instructions to code

• Program maintenance is easier


• Programs are portable
– Contain few machine-dependent details
• Can be used with little or no modifications on different machines
– Compiler translates to the target machine language
– However, Assembly language programs are not portable

21
Assembly Language Programming Tools
• Editor
– Allows you to create and edit assembly language source
files
• Assembler
– Converts assembly language programs into object files
– Object files contain the machine instructions
• Linker
– Combines object files created by the assembler with link
libraries
– Produces a single executable program
• Debugger
– Allows you to trace the execution of a program
– Allows you to view machine instructions, memory, and 22
Assemble and Link Process
Source Object
File Assembler File

Source Object Executable


File Assembler File Linker
File

Link
Source Object
Assembler Libraries
File File

• A program may consist of multiple source files


• Assembler translates each source file separately into
an object file
• Linker links all object files together with link libraries
23

You might also like