Topic 2 Computer Organization
Topic 2 Computer Organization
Topic 2 Computer Organization
COMPUTER ORGANIZATION
WAQAR ALI
https://i.ytimg.com/vi/jFd1qvCS6lM/maxresdefault.jpg
GROUP ACTIVITY
TIME: 08:00 MINS
• Group 1
• Maheen, Hassan, Faizan, Urooj
Q: what are applications of Binary Number System in our Daily
Life. And how it links with the routine decimal number system.
• Group 2
• M. Musa, M. Saad, S. Usman, Ezzah Ali
Q: what are applications of Octal Number System in our Daily Life.
And how it links with the routine decimal number system.
• Group 3
• M. Ali, M. Ibrahim, Abdul hanan, Aisha Abid
Q: what are applications of Hexadecimal Number System in our
Daily Life. And how it links with the routine decimal number system.
DECIMAL TO BINARY CONVERSION
BINARY TO DECIMAL CONVERSION
DECIMAL TO OCTAL CONVERSION
OCTAL TO DECIMAL CONVERSION
DECIMAL TO HEXADECIMAL CONVERSION
HEXADECIMAL TO DECIMAL CONVERSION
HEXADECIMAL TO BINARY
https://www.inchcalculator.com/wp-content/uploads/2021/09/how-to-convert-hex-to-binary.png
https://res.cloudinary.com/witspry/image/upload/witscad/public/content/courses/computer-architecture/data-representation.jpg
INTEGER REPRESENTATION
https://www.electronics-lab.com/wp-content/uploads/2022/07/sign_and_magnitude.png
CHARACTER AND STRING
ASCII → 7 bits used to Unicode→ 8 bits/16 bits
represent only Text • used to represent
• A-Z (26) • Text
• a-z (26) • Non English Characters
• 0-9 (10) • graphics and mathematical symbols
• Controls/punctations (04) • includes characters from almost all of the
living languages of the world
• Others special symbols (62)
• Max Representation:
• UTF(8) 2^8=256
• Max Representation: 2^7=128
• UTF(16) 2^16=65536
file:///C:/D%20DRive/Resources%20From%20Indian%20Teacher/CS%20logic%20gates%20presentation%20(1).pdf
https://t4.ftcdn.net/jpg/01/28/92/69/360_F_128926904_syD57HGXIbo3TU7sIskTpm6Km9jsT0YB.jpg
AND GATE
Examples:
OR GATE
NOT GATE
EXAMPLE
EXAMPLE
A B 𝑨. 𝑩 + 𝑨. 𝑩
0 0
0 1
1 0
1 1
NAND GATE
Input Output
A B 𝑨. 𝑩
0 0
0 1
1 0
1 1
NOR GATE
Input Output
A B 𝑨+𝑩
0 0
0 1
1 0
1 1
• Construct the truth table of the following Circuit?
ACTIVITIES
Draw the logic circuit for the expressions:
1. (A xor B) and not C
2. (P OR Q) AND (R XOR S)
Fetch
Store Decode
Execute
Have a go with this
Components of the CPU interactive demo
○ You need to be able to reproduce this diagram and discuss
everything in it
CPU
Accumulator
(Registers)
[01]
[02]
[..]
Arithmetic [FF]
Logic MDR Data Bus
Unit
This is quite a useful video (although when he says BR buffer register, replace it
with MDR memory data register)
Registers
○ Registers are the smallest and fastest unit of memory in a computer system. They exist within the CPU and
are used to store information that the CPU is working on at that exact moment.
○ Registers you need to know about:
○ Program Counter: Stores the address of the next instruction. [Technically not on the syllabus but
essential to understanding.]
○ Memory Address Register: Stores the address in memory that is to be read or written. When
something happens that involves memory, the MAR stores WHERE it happens. So when a read happens,
the MAR stores the address from which the data will be read and when a write happens the MAR stores
the address at which the data (from the MDR) will be written.
○ Memory Data Register: Stores the data in memory that has been read or is to be written. When
something happens that involves memory, the MDR stores WHAT is read/written. So when a read
happens, the MDR stores the data that has been read and when a write happens, the MDR stores the
information that will be written.
○ Instruction Register: Stores the current instruction that has been transferred to the MDR and is
about to be decoded and executed. Once the data is in the Instruction Register we consider this to be
the end of the Fetch part of the machine instruction cycle. [This register is only mentioned on the HL
syllabus for some reason.]
○ Control unit: The decoder in the control unit is responsible for finding out what the instruction that has
been read does.
○ ALU: The Arithmetic Logic Unit is responsible for executing the instruction.
○ Accumulator: A set of general purpose registers used for storing temporary intermediate results of
the CPU's calculations.
THE CONTROL UNIT AND ALU
Control Unit:
○ The Control Unit decodes instructions
○ The Control Unit contains a component called the decoder, which is
responsible for decoding each instruction into basic opcodes. The
decoder decides what each instruction actually means.
○ It coordinates the other components of the CPU and synchronizes the
movement of data or instructions between registers.
○ It also controls when data is to be read from or written to memory by
means of a read/write signal.
Arithmetic Logic Unit:
○ The ALU carries out instructions to do with arithmetic and logic.
○ The ALU reads operands from registers and writes the results of its
operations into registers.
○ Examples are adding, subtracting, multiplying, complementing (negating),
AND, OR, shifting bits along the register
The Fetch Phase
○ The PC (Program Counter) stores the address of the next instruction in memory.
○ The contents of the PC are copied to the MAR and the PC is incremented.
○ The address is put onto the address bus.
○ The data at that address is read into the MDR.
○ The data returns on the data bus.
○ Input/Output (IO) control: Interacting with screens, keyboards, mice, printers, etc.
○ File management: How/where data is stored on the hard disk. Folder structures.
○ Software/hardware interface: Brokering the relationship between running processes
and physical hardware, e.g. when a word processing application wants to print
something it asks the OS; it doesn't talk directly to the printer.
○ Memory management: Deciding which parts of memory are being used by which
running processes, and which parts of memory are free to be allocated.
○ User interface: Things like windows, buttons, mouse pointers, icons are part of a GUI
or Graphical User Interface. Older OS's used to have a command-line interface, where
you had to type commands because there were no mouse pointers or buttons. The first
guessing game that you programmed had a command-line interface.
○ Scheduling and program execution control: The OS is responsible for swapping running
processes into and out of the CPU. This gives the illusion of being able to do lots of
things at once, which is called multitasking. It's the reason that you can type your
homework and listen to music and download a file all at the same time.
○ Security: There is a separate slide on this.
Operating Systems and Security
○ User management: login with password
○ System of privileges, determining which user or process can do
what, eg delete files, shut down the system, etc
○ Permissions for files and directories, eg read-only
○ Memory management: keeping one process’s or one user's memory
space separate from another’s, ie even if you're logged in to
the same machine, I still can't read any file you have open.
○ Built-in firewall
○ Built-in anti-virus and malware detection
Levels of Memory
○ Primary Memory
○ Primary memory is the main working memory. It is generally
volatile (but see ROM) and is directly accessible by the
CPU.
○ Registers: Smallest, fastest memory, used to hold data that the CPU is
currently working.
○ Cache: Small, fast memory, used to hold very frequently used data.
○ RAM: Random Access Memory. Holds data and instructions from running
programs.
○ ROM: Non-volatile memory, used to hold the operating system's
bootstrap loader (small start-up program) or BIOS.
○ Secondary Memory
Secondary memory comprisesslower but higher capacity
devices that are non-volatile and not directly accessible
by the CPU.
○ Disk storage "Volatile" memory loses its
○ Magnetic tape data when the power is
○ USB flash drives turned off.
○ Cloud storage
SECONDARY MEMORY OPTIONS
Optical disk E.g. CD or DVD. Medium capacity (700Mb - 5Gb). Portable.
Beginning to become obsolete in laptop computers
because of extra hardware required.
○ Note that it's probably better not to use proprietary names in your exam.
Say "spreadsheet software" and not "Excel".
Common Features of Applications
The IB Guide refers to features:
"Including toolbars, menus, dialogue boxes, graphical user interface GUI)
components.
Students should understand that some features are provided by the
application software and some by the operating system."
Operating systems make services available to applications:
○ I/O (input/output) operations
○ File system manipulation (reading/writing files)
○ Frameworks of GUI components
○ Program execution
○ Hardware interface
○ Error detection
All applications need these services, so it makes sense to centralise their provision.
They make the development of software simpler because potentially complex
interaction with hardware is avoided.
Questions
○ Outline two main functions of an operating system. [4 marks]
○ Outline three security features of operating system? [6 marks]
○ Identify two features of application software that are
usually provided by the operating system. [2 marks]
○ Compare optical disks and cloud storage. [4 marks]
○ Explain how a multi-tasking operating system can run more
than one program at the same time. [4 marks]