0% found this document useful (0 votes)
9 views27 pages

Introduction To CA

Uploaded by

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

Introduction To CA

Uploaded by

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

Introductory

Concepts on
numerical
representations
(Part 1)
Topic Outcome

• To learn the concepts on how computer hardware actually work

• To learn the concepts on how computer systems are designed

• To become a good “software designer”, we need to understand how to improve


code performance
What is Computer Architecture

• What does “architecture” mean?


• the art or practice of designing and constructing of something

• What does “computer architecture” mean?


• The science and art of designing, selecting, and interconnecting hardware components and designing the hardware/software
interface to create a computing system that meets functional, performance, energy consumption, cost, and other specific goals.
• Or simply  layout and interactions of a computer system

• https://youtu.be/AkFi90lZmXA?feature=shared
Why I need to learn CA?
• Studying computer architecture is important for several reasons. Firstly, it helps us understand
how computers work at a fundamental level, including the design of the central processing unit
(CPU), memory, and input/output systems. This knowledge is crucial for computer engineers and
scientists to design and optimize computer systems.
• Secondly, understanding computer architecture allows us to develop more efficient software. By
knowing how the hardware operates, software developers can write programs that take full
advantage of the underlying hardware, leading to better performance and more efficient use of
resources.
• Furthermore, studying computer architecture provides insights into the evolution of computing
technology and the challenges associated with designing and building computer systems. This
knowledge is essential for advancing the field of computer science and engineering.
• Ultimately, studying computer architecture is foundational for anyone interested in working with
computers, whether in hardware design, software development, or system optimization.
Example of real world scenario
While migrating software from Sun Sparc machines to Intel based Linux.
One of our tests was failing on Linux. There was code that tested some computation and
made sure the result was correct.
it looked something like this:
1.double r = some_function(fixed_set_of_arguments)
2.if (r == 0.12345) {
3.printf("test passes")
4.}

compiler optimized this code it kept temporary values in the floating point registers
and on Intel chips, floating point registers are longer than 64 bits (the normal size of a double)
to allow for more precision.

So, when the function computed the value it kept it in a register and
when it was compared to the constant, they were not equal.
Level of Transformation
Problem

Algorithm

Program/Language

Runtime System (VM, OS, MM)

ISA (Architecture)

Microarchitecture

Logic

Circuits

Electrons
Abstraction Layers
Application

Software
Compiler
Assembler Operating System

Linker Loader Scheduler Device Drivers


Instruction Set Architecture (Interface SW/HW)
Processor Memory I/O System
Hardware

Datapath & Control Design


Digital Logic Design
Circuit Design
Physical (IC Layout) Design

• Abstraction hides implementation details between levels

• Helps us cope with enormous complexity

• ISA is at the interface between software and hardware


The Power of Abstraction

• Levels of transformation create abstractions


• Abstraction: A higher level only needs to know about the interface to the lower level, not how
the lower level is implemented
• E.g., high-level language programmer does not really need to know what the ISA is and how a
computer executes instructions

• Abstraction improves productivity


• No need to worry about decisions made in underlying levels
Components of a Computer System
Computer
• Input devices Processor Devices

• Keyboard, mouse, … Control Input


Memory
• Output devices
Datapath Output
• Display, printer, …

• Storage devices
• Volatile memory devices: DRAM, SRAM, …
• Permanent storage devices: Magnetic, Optical, and Flash disks, …

• Processor
• The device that computes the instructions into outputs

• Network component
• Essential component for communication in any computer system
Major Components of a Computer

• Central Processing Unit (CPU)

• Random Access Memory (RAM)

• Hard Drive / Disk


Number Systems

• Information is very often represented and managed in a digital format: photos, pictures,
video, music, data are translated to 0s and 1s, and manipulated that way:

• a character can be represented A = 01000001, B = 01000010 . . .


• colours on a scalar scale can be represented by white = 000000 . . . black = 111111
• yes/no or true/false can be represented by yes = 1, no = 0, etc.
• an open switch may be a 1, a closed switch may be a 0
• The meaning of the sequence of 0s and 1s is a matter for interpretation: the symbol 01000001 may be
interpreted as the character A or the number 65.
Number Systems

• We usually use the decimal (base 10) number system

• In computers, the number systems below are used


• Binary is the base 2 number system

• Octal is the base 8 number system

• Hexadecimal is the base 16 number system


Important Number Systems

• The most important number systems for digital computers are:


• binary: base 2. Digits are: 0,1

• octal: base 8, Digits are: 0, 1, 2, 3, 4, 5, 6, 7

• hexadecimal: base 16. Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

• We shall see that hexadecimal and octal numbers are very useful when dealing
with binary numbers, and we’ll learn to use and do arithmetic in each of them
Binary Numbers

• The basis for binary numbers is 2


Radix = 2

The symbols are: 0,1

• The positional value of each binary digit indicates the power of 2, as follows:
Binary Numbers

• According to the previous table the number 11001101 is equivalent to decimal:

= 1x27 + 1x26 + 0x25 + 0x24 + 1x23 + 1x22 + 0x21 + 1x20


= 128 + 64 + 8 + 4 + 1
= 205

• Exercise: find the decimal equivalent of the binary numbers:


• 1101 = ?

• 1111111 = ?
Counting in Binary Numbers
Binary Numbers

• A binary digit is called a bit.

• The bit on the right-hand side is the Least Significant Bit (LSB), while the bit on the left-hand side is the
Most Significant Bit (MSB)

• Digits may have meaning for different bases: 10010 which may be a binary, octal, decimal or hexadecimal number.

• To indicate the basis, use 100102, 745628 and 7456210

• Sometimes a prefix is used, as in % for binary and $ or h for hexadecimal.


Bits and Byte

• Kilo, Mega and Giga are different in binary!


• bit (b) – binary digit

• Byte (B) – 8 binary digits

• KiloByte (KB) – 1024 bytes

• MegaByte (MB) – 1024 kilobyte

• GigaByte (GB) – 1024 megabyte

• TeraByte (TB) – 1024 gigabyte

• Petabyte, Exabyte, Zettabyte, Yottabyte, Brontobyte


Hexadecimal Numbers

• Binary numbers are very easy for computers, but not for human beings

• Compare 1010111100110011111000000101 with the equivalent hex AF33D05

• Hexadecimal and octal are important because of the ease of conversions between both systems and binary.

• The basis for hexadecimal numbers is 16


• Radix = 16 (24)
• The symbols are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Hexadecimal Numbers

Therefore, the number:


1D7E16
= 1 * 163 + D * 162 + 7 * 161 + E * 160
= 1 * 4096 + 13 * 256 + 7 * 16 + 14 * 1
= 755010
The basis for hexadecimal numbers is 16
The symbols are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Hexadecimal Numbers

Exercise: Convert to decimal

$7E = ?

$A8 = ?

$13BF = ?
Counting in Hexadecimal
Octal Numbers

The basis for octal numbers is 8


Radix = 8 (23)

The symbols are: 0, 1, 2, 3, 4, 5, 6, 7

15738
= 1 * 83 + 5 * 82 + 7 * 81 + 3 * 80
= 1 * 512 + 5 * 64 + 7 * 8 + 3 * 1
= 512 + 320 + 56 + 3
= 89110
Octal Numbers

Exercise: Convert to decimal

3048 = ?
15348 = ?
Counting in Octal
Additional source
• https://youtu.be/uTNCVRxuP_c?feature=shared
Next Topic: Introductory Concepts on Numerical
Representations (Part 2)

THANK YOU

You might also like