0% found this document useful (0 votes)
16 views

Introduction To Computer Architecture

Uploaded by

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

Introduction To Computer Architecture

Uploaded by

waziramadhani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

Introduction to Computer Architecture

A computer is an electronic device that can process and


store information. It can perform calculations, manipulate
data, and execute instructions to accomplish specific
tasks.
The basic components of a computer include the central
processing unit (CPU), memory (RAM), storage (hard drive
or solid-state drive), input devices (keyboard, mouse, etc.),
output devices (monitor, printer, etc.), and various
peripheral devices (such as USB drives or external hard
drives).
Computer only understand binary language whose
vocabulary contains only two letters or states or symbols
i.e. 0 and 1, True and False, On and Off. To maintain the
state transistors are used
For example, a memory chip contains hundreds of
millions or even billions of transistors, each of which can
be switched on or off individually. As a transistor can store
2 distinct values, we can have millions of different values
stored on a memory chip consisting entirely of 0’s and 1s.
But how does a transistor get its value? When a very
little amount of electric current passes through the transistor
it maintains the state of 1 and when there is no electric
current then the transistor has the state of 0.
What is CPU?
The CPU is often considered the brain of the computer, as it performs
most of the processing and calculations required for a computer to
function. RAM is the temporary memory that stores data and instructions
while the computer is running, while storage is the long-term memory
where data is stored even when the computer is turned off. Input devices
allow users to input data or commands into the computer, while output
devices display the results of the computer’s processing. Peripheral
devices are additional components that can be added to a computer to
enhance its functionality.
What is a Software?
Software is a set of instructions that tells the computer what to do, when to do, and how
to do it. Examples are, the paint that we use in Microsoft, WhatsApp, and games, all
are types of different software. Suppose we want to add 2 numbers and want to know
what 2 + 2 is 4. Then we must give the computer instructions,
● Step-1: take 2 values.
● Step-2: a store that 2 value
● Step-3: add 2 value by using + operator
● Step-4: save the answer
Now the question is how we give our input.
We give our input with the use of hardware for example like scanner,
keyboard, and mouse(not the one that eats cheese). When we give input
through hardware, the software interprets it into machine language and
then it is processed and our output is shown.
Hardware vs Software
Converting from Decimal to Binary, Hexadecimal, and Octal
https://cdn.cs50.net/2016/x/psets/0/pset0/bulbs.html
Decimal to Binary:

Divide the decimal number by 2.


Record the remainder (0 or 1).
Divide the quotient by 2 and repeat until the quotient is 0.
The binary number is the sequence of remainders read in
reverse order.
Example:
Convert decimal 45 to binary:

45 ÷ 2 = 22 remainder 1
22 ÷ 2 = 11 remainder 0
11 ÷ 2 = 5 remainder 1
5 ÷ 2 = 2 remainder 1
2 ÷ 2 = 1 remainder 0
1 ÷ 2 = 0 remainder 1

Binary: 101101
Decimal to Hexadecimal:

Divide the decimal number by 16.


Record the remainder (0-9 or A-F for values 10-15).
Divide the quotient by 16 and repeat until the quotient is 0.
The hexadecimal number is the sequence of remainders
read in reverse order.
Example:
Convert decimal 45 to hexadecimal:

45 ÷ 16 = 2 remainder D (13 in decimal)


2 ÷ 16 = 0 remainder 2

Hexadecimal: 2D
Decimal to Octal:

Divide the decimal number by 8.


Record the remainder (0-7).
Divide the quotient by 8 and repeat until the quotient is 0.
The octal number is the sequence of remainders read in
reverse order.
Example:
Convert decimal 45 to octal:

45 ÷ 8 = 5 remainder 5
5 ÷ 8 = 0 remainder 5

Octal: 55
Converting Binary to Hexadecimal and Octal
Binary to Hexadecimal:

Group the binary digits into sets of 4, starting from the right.
Add leading zeros if needed.
Convert each group of 4 binary digits to its hexadecimal
equivalent.
Example:
Convert binary 101101 to hexadecimal:

Group: 101101 → 0010 1101 (add two leading zeros)


Convert: 0010 = 2, 1101 = D

Hexadecimal: 2D
Binary to Octal:

Group the binary digits into sets of 3, starting from the right.
Add leading zeros if needed.
Convert each group of 3 binary digits to its octal equivalent.
Example:
Convert binary 101101 to octal:

Group: 101101 → 101 101 (no leading zeros needed)


Convert: 101 = 5, 101 = 5

Octal: 55
Converting Hexadecimal and Octal to Binary
Hexadecimal to Binary:

Convert each hex digit to its 4-bit binary equivalent.


Example:
Convert hexadecimal 2D to binary:

2 = 0010
D = 1101

Binary: 00101101
Octal to Binary:

Convert each octal digit to its 3-bit binary equivalent.


Example:
Convert octal 55 to binary:

5 = 101
5 = 101

Binary: 101101
Summary of Conversion Table:

You might also like