Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 55

LECTURE 2

Electrical Engineering Department


Previous Lecture
• Information Technology
- it is a combination of computer technology
and communication technology
• IT Terms
- cyberspace
- internetwork
-multimedia
-world wide web

Electrical Engineering Department EC121 2


Categories of Computers

For individuals For organizations


• Desktop • Mainframe
• Workstation • Minicomputers
• Tablet computers • Network servers
• Notebook • Super computers
• Handheld

http://publib.boulder.ibm.com/infocenter/zos/basics/index.jsp?to
pic=/com.ibm.zos.zmainframe/zconc_whatismainframe.htm

Electrical Engineering Department EC121 3


Where Is Information Technology Headed?
Three Directions of Computer Development

•Miniaturization

•Speed

•Affordability

Then (1946ENIAC)

Now

Electrical Engineering Department EC121 1A-4


Where Is Information Technology Headed?
Three Directions of Communication Development

•Connectivity

•Interactivity
Auto PC
•Multimedia

Image Courtesy:
http://blog.wired.com/cars/images/2007/05/31/t
elematics.jpg

Electrical Engineering Department EC121 1A-5


When Computers & Communications Combine:
Convergence, Portability, & Personalization

•Convergence

•Portability

•Personalization

Image courtesy:
http://en.wikipedia.org/wiki/Wearable_comp
uter

Electrical Engineering Department EC121 1A-6


Moving on to Computer…

Electrical Engineering Department


What is a computer?
a device that computes

Electrical Engineering Department EC121 8


Essential Computer Hardware
• Input and output devices
– Allows the user to interact
– Input devices accept data
• Keyboard, mouse
– Output devices deliver data
• Monitor, printer, speaker
– Some devices are input and output
• Touch screens

Electrical Engineering Department EC121


1B-9
Electrical Engineering Department EC121 10
What is Processing?
• Conversion of Data into Information
• Data
– The raw facts and figures that are processed into
information
• Information
– Data that has been summarized or otherwise
manipulated for use in decision making

Electrical Engineering Department EC121 11


Electrical Engineering Department EC121 12
Types of Data
• Numeric
– Record Daily Milk Expenses
• Sun 20 Rs
• Mon 30 Rs
• Tues 35 Rs
• Wed 23 Rs
• Thurs 34 Rs
• Fri 50 Rs
• Sat 30 Rs

Electrical Engineering Department EC121 13


Types of Data
• Numeric
– Processing Data
• Finding Weekly expenditure on Milk
• Finding a Daily Average of milk expenditure

20,30,35,23,
Find Total/Average 222/31.7
34,50,30

Electrical Engineering Department EC121 14


Types of Data
• Text
– Raw:

one of the most important concepts students must understand is


the fundamental difference between data and information

– Processed (1): Formatted

“One of the most important concepts students must understand


is the fundamental difference between data and information.”

– Processed (2): Words arranged alphabetically

and between concepts data difference fundamental important


information is most must of one students the the understand

Electrical Engineering Department EC121 15


Types of Data
• Image
– Raw

– Processed

Electrical Engineering Department EC121 16


Types of Data
• Audio
– Raw: Conversation between people in cockpit of
aircraft and Flight Controller recorded in Black
box
– Processed: In case of air crash, the recorded
audio will be converted to digital form, background
noise will be removed, and the clarity of speech
will be improved to assist investigators

Electrical Engineering Department EC121 17


Types of Data
• Video
– Raw: Old Black and White movies
– Processed: Black and white movie made colored

– Raw: Any Video in foreign language


– Processed: Dub it in Urdu

Electrical Engineering Department EC121 18


Data representation

How computers represent data?

Electrical Engineering Department


Data Types
• Numbers
• Text
• Graphics
• Sound

Electrical Engineering Department EC121 20


How Computers Represent Data

Electrical Engineering Department EC121 21


How Computers Represent Data
• Number systems
– A manner of counting
– Several different number systems exist
• Decimal number system
– Used by humans to count
– Contains ten distinct digits
• Origin: Probably because human beings normally
have 10 fingers
– Digits combine to make larger numbers

Electrical Engineering Department EC121 22


How Computers Represent Data
• Computers use electronic switches called
transistors
• A switch can either be ON or OFF

=1 =0

• Only two numeric values can be represented


by one switch, 0 and 1

Electrical Engineering Department EC121 23


How Computers Represent Data
• Binary number system
– Used by computers to count
– Two distinct digits, 0 and 1
– 0 and 1 combine to make numbers

Electrical Engineering Department EC121 24


How Computers Represent Data
• Bits and bytes
– Binary numbers are made of bits
– Bit (Binary Digit) represents a switch
– A byte is 8 bits
– Byte represents one character

Electrical Engineering Department EC121 25


How Computers Represent Data
– Any number from the decimal number system can
also be written using binary number system
– Decimal to Binary conversion is required
– Each digit in the decimal number system has a
place value
• Ones (100), Tens(101), Hundreds(102),
Thousands(103)

Electrical Engineering Department EC121 26


How Computers Represent Data
Decimal Number System
– The place value is expressed in powers of 10
• 10 to the power of digit position
• 10 is called the base of the Decimal number
system

Image Courtesy: www.emu8086.com


Electrical Engineering Department EC121 27
How Computers Represent Data
• Binary Number System
– In binary number system the base is 2
– Place value is 2 to the power of digit position
• Quadword - 64 bits

Electrical Engineering Department EC121 28


Conversion from Binary to Decimal
• Binary number system has a base ‘2’
• For conversion calculate place value of each digit
position and multiply by the corresponding digit value
(0 or 1)

(1 1 0 0 1)2

24 23 22 21 20
=1x 24 + 1x 23 + 0x 22 + 0x 21 + 1x 20
= 1x16 + 1x8+ 0x4+ 0x2 + 1x1
= 16 + 8 + 0 + 0 + 1 = 2510

Electrical Engineering Department EC121 29


Conversion from Binary to Decimal
• What is the decimal equivalent of (10100101)2?

Electrical Engineering Department EC121 30


Other number systems
• Hexa-Decimal Number System
– 16 possible values
– 0,1,2,…9,A,B,..F
– Base 16

• Octal Number System


– 8 possible values
– 0,1,2,..7
– Base 8

Electrical Engineering Department EC121 31


Conversion from Binary to Hexadecimal
Decimal Binary Hexadecimal
• Every nibble (4 (base 10) (base 2) (base 16)
bits) can be 0 0000 0
converted to a 1 0001 1

hexadecimal digit 2 0010 2

using this table 3 0011 3


4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F
Electrical Engineering Department EC121 32
Conversion from Hexadecimal to Decimal
• Same as with binary to decimal conversion, only the
base is now 16, instead of 2

Electrical Engineering Department EC121 33


Conversion from Decimal to other
number systems
• Divide the decimal value by the base of the desired
system
• Each time, remember the result and keep the
remainder
• Continue the division process until the result is zero
• The remainders are then used to represent a value in
that system

Electrical Engineering Department EC121 34


Binary Coded Decimal
• Each decimal digit is represented by its own
binary sequence
• Allows easy conversion to decimal digits for
printing or display
– Map digits 0-9 to some binary values
– 0-9 are 10 digits
– 3 bits can have 8 combinations
– 4 bits can have 16 combination
– We would have to use 4 bits since 10 > 8
– So each decimal digit is converted to its 4-bit
binary representation

Electrical Engineering Department EC121 35


Binary Coded Decimal
• 010  00002 , 110  00012 ,…, 910  10012
– So 910  0910  0000 10012
– 1010  0001 00002

Electrical Engineering Department EC121 36


Text Codes
• Text codes
– Converts letters into binary
– Standard codes necessary for data transfer
– ASCII

Electrical Engineering Department EC121 37


Graphic Codes
– Extended ASCII – 8 bits
• Graphics and other symbols

Electrical Engineering Department EC121 38


Unicode
– UTF 8
– UTF 16
– UTF 32
• All languages on the planet

Electrical Engineering Department EC121 39


Data Representation
How is a character sent from the keyboard to the computer?

Step 1 :
The user presses the letter T key on
the keyboard
Step 2:
An electronic signal for the letter T
is sent to the system unit
Step 3:
The signal for the letter T is
converted to its ASCII binary code
(01010100) or Unicode U+0054
and is stored in memory for
processing
Step 4:
After processing, the code for the
letter T is converted to an image on
the output device
Electrical Engineering Department EC121 40
How Computers Process Data?

Electrical Engineering Department


Information Processing Cycle
Steps followed to process data
• Input
• Storage
• Processing
• Output
• Controlling

For details
http://www1.pacific.edu/comp25/reading/1-
InfoProcessingCycle.html
Electrical Engineering Department EC121
1B-42
Central Processing Unit
• An extensive set of electronic circuitry that
executes stored program instructions
• In an average microcomputer, the CPU is a
single unit called the ‘microprocessor’
• Two parts:
– Control Unit
– Arithmetic Logic Unit (ALU)

Electrical Engineering Department EC121 43


Control Unit
• Contains circuitry that uses electrical signals to direct the
entire computer system to execute stored program
instructions
• It does not execute program instructions; rather, it directs
other parts of the system to do so
• The control unit must communicate with both the ALU and
the memory
• The instruction set lists all operations the CPU can perform
• Each instruction is expressed in microcode
• Control Unit does the following
– Move data from one place to another; from memory to
storage or to printer etc.
– Passes instructions involving arithmetic/logical operations
to the ALU

Electrical Engineering Department EC121 44


Arithmetic Logic Unit
Performs:
• Arithmetic Operations
– Addition,Subtraction,Multiplication,Division
• Logical Operations
– Comparisons
• equal to, less than, greater than, less than or
equal to, greater than or equal to, and not equal

Electrical Engineering Department EC121 45


Arithmetic Logic Unit
• Contains a group of registers
• A register is a high-speed memory location built
directly into the CPU to hold data
– e.g., the numbers that are to be added are stored
in registers and the result of the computation is
stored in another register before being sent out

Electrical Engineering Department EC121 46


Register
Register is a single storage location inside the CPU

Name of register Function


Memory Address register Holds the address of the
active memory location
Memory Buffer Register Holds the information on
its way to and from
memory
Program control Register Holds the address of the
next instruction to be
executed
Accumulator register Accumulates results and
data to be operated upon
Instruction Register Holds an instruction, while
it is being executed
Input/output Communicates with the
I/O devices
Electrical Engineering Department EC121 47
Machine Cycle
• Steps performed by CPU to process data
• Consists of
– Instruction Cycle and
– Execution Cycle

Electrical Engineering Department EC121 48


Machine Cycle
• Instruction cycle
– Fetch: Control Unit retrieves
a command/data from memory
– Decode: Control Unit breaks
down the command into
instructions that correspond
to those in CPU’s instruction
set
• Execution cycle
– CPU performs the instruction
– Stores the result in register
or memory

Electrical Engineering Department EC121 49


Steps
• Control unit takes the address of the next program
instruction to be executed from the PC and reads the
instruction from the corresponding memory address into
the IR
• The control unit then sends the operational part and the
instructional part to the decoder and the MAR respectively
• The decoder interprets the instruction, and the control unit
sends signals to the appropriate unit.
• Control unit also ensures that the data corresponding to
the address part of the instruction is loaded in the specific
register
• Each instruction is executed, the addres of the next
instruction is automatically loaded into PC

Electrical Engineering Department EC121 50


Example
Step
Step4:
Step 1:
2: The
The control
AStep 3:The
student The
enters
ALUa
control
unit decodes
results unit
of the the
math
executes
problem the into
fetches
mathproblem
math problem
the math and
the
math
memory
problem ofare
the
problem
sendsin
stored it from
to the ALU
memory
computer
memory
The result in
memory displays
on the screen of
the monitor

Electrical Engineering Department EC121 51


Memory
• Memory
– Stores open programs and data
– Small chips on the motherboard or on a small
circuit board attached to the motherboard
– More memory makes computer applications run
faster

Electrical Engineering Department EC121 52


Memory

Volatile memory
volatile Memory
Loses its contents when the
nonvolatile
Loses its contents memory
computer's power is turned off
when the computer's
power is turned off Does not lose its
contents when the
computer’s power
is turned off

Electrical Engineering Department EC121 53


The Role of Memory
• RAM stores data and program code
needed by the CPU. The contents of
RAM change rapidly and often.

• Read-only memory (ROM) is nonvolatile


(or permanent). It holds instructions that
run the computer when the power is first
turned on.

• The CPU accesses each location in


memory by using a unique number, called
the memory address

Electrical Engineering Department EC121 54


References
• http://www.oopweb.com/Assembly/Documents
/ArtOfAssembly/Volume/Chapter_1/CH01-1.h
tml
• http://www.joelonsoftware.com/articles/Unic
ode.html
• http://diveintopython3.org/strings.html

Electrical Engineering Department EC121 55

You might also like