Chapter 2
Chapter 2
Chapter 2
Lecture 1
Outline
n Introduction to the course
q General information
q Syllabus
q Course arrangment
q General rules
n Why Assembly?
n Blast from the past
n Layered Perspective of Computing
n Data Representation
q Base 2, 8, 10, 16 Number systems
q Course arrangment
q General rules
Abacus
Slide rule
Half Adder
Blast from the past cont.2
Vacuum Tube
vacuum tube: is a device that controls electric current flow in a high vacuum
between electrodes to which an electric potential difference has been applied.
https://www.youtube.com/watch?v=nA_tgIygvNo&ab_channel=RobRobinette
Blast from the past cont.3
n Memory ?!!
Punched Card
A punched card is a piece of card stock that stores digital data using punched holes.
Punched cards were once common in data processing and the control of automated
machines.
Blast from the past
C++ language
cout<<(A*B+C)
Notes
• In the Past, the processor came with a sheet used to learn which code belong to which arithmetic
operation such as: addition, subtraction, and multiplication.
• To perform the multiplication operation, we must use another code, and therefore the sheet must always be
used.
Of course, using sheet with various arithmetic operations is a very difficult thing.
• Example: If we have a memory called eax and a value called A, we use Mov to insert the value A into the eax
memory.
All these operations can be done and print it by using just one command in C++ programing
Count << (A*B+C)
Outline
n Introduction to the course
q General information
q Syllabus
q Course arrangment
q General rules
n Blast from the past
n Why Assembly?
n Layered Perspective of Computing
n Data Representation
q Base 2, 8, 10, 16 Number systems
n Boolean operations and algebra
Why Assembly
n Games, Graphics
Program execution:
Interpretation
Compilation (Translation)
Every CPU has a built-in interpreter for its own "instruction set"
(ISA, Instruction Set Architecture; the binary language it is
programmed in)
Machine Levels
High Level
Level 4
Language
Instruction Set
Level 2 Architecture (ISA)
• C Compiler (translator)
Microsoft C
Compiler • Produces assembly language (object file)
• Then comes the linker, which links some files and thus turns the
program into an exe file.
Java – Different Concepts
• Programmer
JEdit •Produces a Java Program
The answer is no. At one of the stages of the C program, the program is
converted into an object file, which contains machine code inside it, and
the machine code is linked to the processor only. This means that if a
compiler is made on the C program inside a device that contains a
processor such as: Intel processor, the C program will work on another
device that contains only Intel processor and will not work on another
operating system such as: Linux or Mac. If we want to run this program
on another operating system such as Linux, we must take the source
code of the C program and complier it again using the existing complier
on the Linux system.
Notes
• To solve this problem, Java program was used, where instead of
converting the program instructions to assembly language. It will be
converted into a class file, and then we can run the program on any
other device or operating system by using Java Virtual Machine.
The Key Concepts
1. A High-Level Language (C, C++, Fortran, Cobol)
High Level
is compiled (translated) into Assembly
Language
Language
Assembly
2. The Assembly Language (for a specific CPU) Language
Or
.exe
1. x = 5 counter take the order from memory to processor
2. y = 10 counter take the order from memory to processor
3. x+y counter take the order from memory to processor
Assembly Language
• It can also be used to solve the problem of requesting the serial number
in some programs by hacking the serial number instructions of these
programs through their object file.
CPU Instruction Set