You are on page 1of 24

Computer Organization &

Assembly Language
Dr. Irfan Yousuf
Department of Computer Science (New Campus)
UET, Lahore
(Lecture # 3; October 5, 2020)
Outline
• Previous Lecture(s)
• Data Representation & Number Systems
• Data Organization
Previous Lecture(s)
• Computer Organization
• Central Processing Unit (Control Unit & Arithmetic and Logic Unit)
• Memory
• I/O subsystem
• Binary Numbers
• 1s and 0s
• Assembly Language
• Machine Language
• Assembler
Data Representation
• Computer systems do not represent numeric values using the decimal system.
• Instead, they use Binary system, i.e., 0s and 1s

Click to add text


Number System
• Decimal Numbers
• Binary Number System
• Hexadecimal
Decimal Number System
• It uses 10 symbols (0,1,2,3,4,5,6,7,8,9)
• Base-10 system
• Number 123 in decimal

• Number 123.456 in decimal


Binary Number System
• It uses 2 symbols (0,1)
• Base-2 system
• Number 110010102
Hexadecimal Number System
• It uses 16 symbols (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)
• Base-16 system
• Number 123416
Hexadecimal Number System

Examples of Hexadecimal Numbers


Short Quiz
• Find the value of X
• (10110011)2  (X)10
• (A2DF)16  (X)10
Data Organization
• Bits
• Nibbles
• Bytes
• Word
• Double Word
Bit
• The smallest “unit” of data on a binary computer is a single bit.
• Binary Digit  Bit
• With a single bit, you can represent any two distinct items.
• On / Off
• True / False
Nibble
• A nibble is a collection of four bits.
• With a nibble, we can represent up to 16 distinct values.
• Hexadecimal Numbers
Byte
• The most important data structure / group.
• A byte consists of eight bits and is the smallest addressable datum (data item) on the 80x86
microprocessor.
• It can represent 28, or 256, different values. (0 to 255)
• The bits in a byte are normally numbered from zero to seven (right to left).
• Bit 0 is the low order bit or least significant bit, bit 7 is the high order bit or most significant bit
of the byte

MSB LSB
Word
• A word is a group of 16 bits.
• It can represent 216, or 65,536, different values. (0 to 65,535)
• The bits in a word are normally numbered from zero to fifteen (right to left).
Double Word
• A double word is exactly what its name implies, a pair of words. Therefore, a
double word quantity is 32 bits long.
• It can represent 232, or 4,294,967,296 different values. (0 to 4,294,967,295)
• The bits in a word are normally numbered from zero to thirty-one (right to left).
Arithmetic of Number Systems
• Re-vise basic arithmetic operations for
• Decimal, Binary and Hexadecimal Numbers
Instruction Format
• Computers perform tasks on the basis of instructions provided.
• An instruction in computer comprises of groups called fields.
• An instruction is of various length depending upon the number of addresses it
contains.
• 3-address
• 2-address
• 1-address
• 0-address
3- address Instruction Format
• It has one opcode and three address fields.
• One address field is used for destination and two address fields for source

ADD X, A, B

MUL Y, A, B
2- address Instruction Format
• It has one opcode and two address fields.
• One address field is common and can be used for either destination or source and
other address field for source.

ADD A, B

MUL A, B
1- address Instruction Format
• It has only two fields. One for opcode and other for operand.
• One Operand is in Accumulator (AC) and the other is in register or memory
whose address is given in the instruction.

LOAD A ;Load the contents of A into AC

ADD B ;Add the contents of B and AC


0- address Instruction Format
• It has one opcode and no address fields.
• Used by stack-based computers

PUSH A

PUSH B

ADD
Summary
• Number Systems
• Data Organization
• Instruction format
Questions?

You might also like