Unit2 COA
Unit2 COA
UNIT-2
Topic : Basic Structure of a Computer
Main Frame: Large expensive computer capable of simultaneously processing data for
hundreds or thousands of users. Used to store, manage, and process large amounts of data
that need to be reliable, secure, and centralized.
Hand Held: It is also called a PDA (Personal Digital Assistant). A computer that fits into a
pocket, runs on batteries, and is used while holding the unit in your hand. Typically used as
an appointment book, address book, calculator and notepad.
Multi Core: Have Multiple Cores – parallel computing platforms. Many Cores or computing
elements in a single chip. Typical Examples: Sony Play station, Core 2 Duo, i3, i7 etc.
10/03/2025 21CSS201T - Computer Organization and Architecture 6
10/03/2025 21CSS201T - Computer Organization and Architecture 7
FUNCTIONAL UNITS OF COMPUTER
• Input Unit
• Output Unit
• Central processing Unit (ALU and Control Units)
• Memory
• Bus Structure
– Data PROCESSING
– Data STORAGE Data =
– Data MOVEMENT Information
– CONTROL Coordinates How
Information is Used
R2
Add R1, R2
T1 Enable R1
T2 Enable R2
store 1 bit.
Data is usually accessed in n-bit •
•
•
groups. n is called word length. i th word
•Data is transferred to and from memory in groups of bits called words. A word can be a
group of 8 bits, 16 bits, 32 bits or 64 bits (and growing).
•If the word is 8 bits, it is referred to as a byte. The term “byte” is so common in computer
science that sometimes a 16-bit word is referred to as a 2-byte word, or a 32-bit word is
referred to as a 4-byte word.
•The total number of uniquely identifiable locations in memory is called the address
space.
•For example, a memory with 64 kilobytes (16 address line required) and a word size of 1
byte has an address space that ranges from 0 to 65,535.
A computer has 32 MB (megabytes) of memory. How many bits are needed to address any
single byte in memory?
Solution
The memory address space is 32 MB, or 225 (25 × 220). This means that we need log2 225, or 25
bits, to address each byte.
Example 2
A computer has 128 MB of memory. Each word in this computer is eight bytes. How many bits
are needed to address any single word in memory?
Solution
The memory address space is 128 MB, which means 227. However, each word is eight (23)
bytes, which means that we have 224 words. This means that we need log2 224, or 24 bits, to
address each word.
10/03/2025 21CSS201T - Computer Organization and Architecture 40
MEMORY OPERATIONS
• Today, general-purpose computers use a set of instructions called a program to
process data.
• A computer executes the program to create output data from input data
• 96
8000
• 78
8001
• 8002 46
• 8003 |
• 8004
10/03/2025 21CSS201T - Computer Organization and Architecture 44
Big Endian
• Big Endian (e.g., in IBM, Motorolla, Sun, HP)
» high order byte stored at lowest address
» byte3 byte2 byte1 byte0
W ord
address Byte address Byte address
0 0 1 2 3 0 3 2 1 0
4 4 5 6 7 4 7 6 5 4
• •
• •
• •
k k k k k k k k k k
2 - 4 2 - 4 2 - 3 2 - 2 2 - 1 2 - 4 2 - 1 2 - 2 2 - 3 2 - 4
10/03/2025
(a) Big-endian (b) Little-endian
21CSS201T - Computer Organization and Architecture 46
assignment Byte and word addressing. assignment
• In case of 16 bit data, aligned words begin at byte addresses of 0,2,4,
………………………….
• In case of 32 bit data, aligned words begin at byte address of 0,4,8,
………………………….
• In case of 64 bit data, aligned words begin at byte addresses of 0,8,16,
………………………..
• In some cases words can start at an arbitrary byte address also then, we say
that word locations are unaligned
• Memory cell pointed to by address field contains the address of (pointer to) the
operand
Two references to memory are required to fetch the operand.
• Effective Address = [A]
• Look in A, find address (A) and look there for operand
• e.g. ADD (A)
• Add contents of cell pointed to by contents of A to the accumulator
Address bus
ALU Register Section
Data bus
Control bus
• 16-bit register
• contains 9 flags
• remaining 7 bits are idle in this register
• These flags tell about the status of the processor after any arithmetic or logical
operation
• IF the flag value is 1, the flag is set, and if it is 0, it is said to be reset.
• An example of an instruction is
START: MOV CX,5 ; initialize counter
• An operand field specifies the data that are to be acted on by the operation.
• An instruction may have zero, one, or two operands. For example:
NOP No operands; does nothing
ADD WORD1,2 two operands; adds 2 to the contents of memory word WORD1
• A semicolon marks the beginning of this field, and the assembler ignores anything
typed after semicolon.
• Comments are optional, but because assembly language is low level, it is almost
impossible to understand an assembly language program without comments.
• More compactly as
message DB ’Bye’,0DH,0AH
• Any consecutive storage locations of the same size can be called an array
X DW 40CH,10B,-13,0
Y DB 'This is an array'
Z DD -109236, FFFFFFFFH, -1, 100B
• Components of X are at X, X+2, X+4, X+6
• Components of Y are at Y, Y+1, …, Y+15
• Components of Z are at Z, Z+4, Z+8, Z+12
Example
stars DB 4 DUP(3 DUP (’*’),2 DUP (’?’),5 DUP (’!’))
Reserves 40-bytes space and initializes it as
***??!!!!!***??!!!!!***??!!!!!***??!!!!!
• Word, doubleword, and quadword data are stored in reverse byte order (in
memory)
Directive Bytes in Storage
DW 256 00 01
DD 1234567H 67 45 23 01
DQ 10 0A 00 00 00 00 00 00 00
X DW 35DAh DA 35
• name = expression
• expression must be numeric
• these symbols may be redefined at any time
maxint = 7FFFh
count = 1
DW count
count = count * 2
DW count