0% found this document useful (0 votes)
28 views30 pages

Lecture 1

Uploaded by

hiraazhar2030
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views30 pages

Lecture 1

Uploaded by

hiraazhar2030
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Computer Organization

& Assembly Language


CS-2101

Week 1
Lecture 1
Instructor Details
Engr. Dr. Muhammad Ayoub Kamal
Email: [Link]@[Link]

Recently, done PhD in IT from the Malaysian Institute of Information


Technology University Kuala Lumpur, Kuala Lumpur, Malaysia. Received
Master of Engineering degree in Information Technology and Bachelor of
Engineering degree in Computer System Engineering from Mehran
University of engineering and Technology in 2015, 2012 respectively.
9 plus years of experience in fieldwork and academic institutions.
Published 17 research articles in national and international research
journals. Areas of research are wireless sensor network (WSN), long range
technology (LoRA), internet of things (IoT), machine to machine
communication (M2M), machine learning (ML) and artificial intelligence (AI).
• Rules & Regulations: (Strictly Comply)
- Onsite Classes/Lectures are mandatory for all.
- Class decorum must be maintained during
Onsite/online sessions.
- No late Joining will be entertained, arrival after
10 minutes marked as ABSENT (min 75%
attendance required for exams).
- No LAME excuses will be entertained.
- No Make-ups/Late submissions for
Assignments & Quizzes etc.
Text Book:
• Computer Organization and Design, The
hardware/software Interface, 3rd edition, David Patterson
and John L Hennessy (available in Lib)

Reference Books:
• Computer Architecture, A quantitative approach, 4th
edition, John L Hennessy and David Patterson (available in
Lib)

• Computer Architecture, A quantitative approach, 5th


edition, John L Hennessy and David Patterson
Marks distribution
• Mid Term: 30 marks (after 8 weeks)
– Mid Semester Examinations
• Final Exam: 40 marks (after 16 weeks)
– Final Examinations
• Sessional: 30 marks
– Class Room Performance
– Assignments (in-class + take-home)
– Quizzes (announced + surprise)
– Presentations
– Projects
– Class Tasks
5
Introduce Yourself
• Full Name

• Previous semester CGPA

• Which areas of CS are you more interested in


AI, Web Developing, Games, Software
Developing, Cyber security, etc
Chapter 1
Computer Abstractions and Technology
The Computer Revolution
• Progress in computer technology
– Underpinned by Moore’s Law
– Moore’s Law
• The number of transistors per square inch on integrated circuits
had doubled every year since the integrated circuit was invented
• Makes novel applications feasible
– Computers in automobiles
– Cell phones
– Human genome project
– World Wide Web
– Search Engines
• Computers are pervasive
Classes of Computers
• Desktop computers
– General purpose, variety of software
– Subject to cost/performance tradeoff
• Server computers
– Network based
– High capacity, performance, reliability
– Range from small servers to building sized
• Embedded computers
– Hidden as components of systems
– Stringent power/performance/cost constraints
Computer Organization
• Six logical units in every computer:
– Input unit
• Obtains information from input devices (keyboard, mouse)

– Output unit
• Outputs information (to screen, to printer, to control other devices)

– Memory unit
• Rapid access, low capacity, stores input information

– Arithmetic and logic unit (ALU)


• Performs arithmetic calculations and logic decisions

– Control unit (CPU)


• Coordinates the various components of the computer

– Secondary storage unit


• Cheap, long-term, high-capacity storage
• Stores inactive programs
Software Categories
• System SW
– Programs written for computer systems
• Compilers, operating systems, …

• Application SW
– Programs written for computer users
• Word-processors, spreadsheets, &
other application packages
Operating System (OS)

· Provides several essential services:


– Loading & running application programs
– Allocating memory & processor time
– Providing input & output facilities
– Managing files of information
Evolution of Operating Systems
• Single user Batch processing
– Do only one job or task at a time
• Early Operating systems
– Manage transitions between jobs (minimizing
transition time between jobs)
– Increased throughput
• Amount of work computers process
• Multiprogramming
– Computer resources are shared by many jobs
or tasks (users still waited a long time for their
output)
• Timesharing (access computers via terminals)
– Computer runs a small portion of one user’s
job then moves on to service the next user
How to communicate with a computer

• Computer performs wide range of daily life


tasks such as write documents, playing
games, listen to music, watch videos etc.

• How does a computer perform all such


tasks??

14
How to communicate with a computer
To performs all such tasks,
• Different sequence of instructions (programs) are
needed to be provided to the computers.
• The provided instructions are then executed by
the computers in form of accomplished tasks.
• The sequence of instructions, we can provide to
the computers are in its own language or in our
own language.
• This leads to the concept of programing
languages.
15
Programming Language : Definition

• A vocabulary and set of grammatical rules


for instructing a computer to perform
specific tasks.
Programs
• Programs are written in programming
languages
– Pieces of the same program can be written in
different programming languages
• Languages closer to the machine can be more efficient
• As long as they agree on how to communicate

• A programing language is
– A special purpose and limited language
– A set of rules and symbols used to construct a
computer program
– A language used to interact with the computer
Programming languages

• Low Level Languages

• High Level Languages

18
Computer Languages
– Machine Language (LLL)
• Uses binary code
• Machine-dependent
• Not portable
• Assembly Language (LLL)
– Uses mnemonics
– Machine-dependent
– Not usually portable
• High-Level Language (HLL)
– Uses English-like language
– Machine independent
– Portable (but must be compiled for different
platforms)
– Examples: Pascal, C, C++, Java, Fortran, . . .
Low level languages
• Low level languages are closer to Computer
Hardware

• These are written in the form that can be directly


or easily understandable by the computers’
Central Processing Unit (CPU).

• Examples of low level languages are Machine


Language and Assembly Language.

20
Machine language

• It is a language in which instructions for


computers are written in form of binary strings
(0s and 1s)

• Binary digits/strings is natural language of


computers and can be directly understood by
them.

21
Machine Language
• The representation of a computer program which is
actually read and understood by the computer.
– A program in machine code consists of a sequence
of machine instructions.
• Instructions:
– Machine instructions are in binary code
– Instructions specify operations and memory cells
involved in the operation

Example: Operation Address

0010 0000 0000 0100


0100 0000 0000 0101
0011 0000 0000 0110
Machine language
• For specific operations in this language, binary codes are
used, therefore, for each different processor, different
machine language is used.

• It is easily understandable for the computers but difficult


for users/programmers(difficult to memorize different
codes).

• An example of Machine Codes: 0010011010011001,


1101010011100101, 1100010101001010,
0100101101010010, 1101011000101100

23
Assembly language

• Mnemonics (symbolic names/codes) are used


instead of binary codes e.g. ADD, SUB, MUL, DIV

• For each program instruction, a separate


mnemonic is used.

24
High level languages
HIGH
• High level languages (HLL) are more closer to Human
languages but far from computer understandable Python
language. AppleScript

Java Script
Java, C#
• These languages are easier for programmers to
implement. C++

C
• Like an assembler, HLL need a translator (Compiler or
Assembly
interpreter) to translate them into the form Language
understandable for computers (binary codes). Machine
Language
LOW

• Popular examples of HLL are C, C++, Java, Python etc.

25
High-level language

• A programming language which use statements


consisting of English-like keywords such as "FOR",
"PRINT" or “IF“, ... etc.
• Each statement corresponds to several machine language
instructions (one-to-many correspondence).
• Much easier to program than in assembly language.
• Data are referenced using descriptive names
• Operations can be described using familiar symbols
Assembler, Compiler and Interpreter

27
Understanding Performance
• Algorithm
– Determines number of operations executed
• Programming language, compiler, architecture
– Determine number of machine instructions executed per
operation
• Processor and memory system
– Determine how fast instructions are executed
• I/O system (including OS)
– Determines how fast I/O operations are executed
Below Your Program
• Application software
– Written in high-level language
• System software
– Compiler: translates HLL code to
machine code
– Operating System: service code
• Handling input/output
• Managing memory and storage
• Scheduling tasks & sharing resources
• Hardware
– Processor, memory, I/O controllers
Levels of Program Code
• High-level language
– Level of abstraction closer to
problem domain
– Provides for productivity and
portability
• Assembly language
– Textual representation of
instructions
• Hardware
representation
– Binary digits (bits)
– Encoded instructions and
data

You might also like