Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
35 views

Introduction To Computer and Programming

The document discusses the basic components of a computer including hardware such as the central processing unit, memory, storage, and input/output devices. It also covers computer software including system software that manages computer operations and application software designed for specific tasks. Programming languages are described as either low-level languages that communicate directly with hardware or high-level languages that are closer to human language.

Uploaded by

Sky Fire
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Introduction To Computer and Programming

The document discusses the basic components of a computer including hardware such as the central processing unit, memory, storage, and input/output devices. It also covers computer software including system software that manages computer operations and application software designed for specific tasks. Programming languages are described as either low-level languages that communicate directly with hardware or high-level languages that are closer to human language.

Uploaded by

Sky Fire
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

BFC 20802 COMPUTER

PROGRAMMING

DR. GOH WAN INN

Room: M157 North east tower level 1, FKAAB


wigoh@uthm.edu.my

1
3
What Is Computer?
• An electronic device, operating under the control of
instructions stored in its own memory
• Two major components

Computer

Hardware Software

4
Why Program?
Computer – programmable machine designed to follow
instructions
Program – instructions in computer memory to make it do
something
Programmer – person who writes instructions (programs) to
make computer perform a task

SO, without programmers, no programs; without programs, a


computer cannot do anything
Types of Computer
Personal computers

Mobile computers & mobile devices

Game consoles

Servers

Mainframes

Supercomputers

Embedded computers 6
Computer’s Component
Main Component (Hardware) of computer;

8
Computer’s Component (cont…)
• The architecture of a typical computer, usually consists of;
– System Unit (CPU)
• power of the computers. Consist of ALU and control unit.
– Main Memory (RAM & ROM)
• stores information to be processed or instructions on how to process
information.+ 2nd Storage (mass storage - tapes, optical discs, magnetic
disc, etc.)
– Peripherals devices
• 2 types;
1. Input Devices – keyboards, mouse, laser pointer, digital pen, etc.
2. Output Devices – monitors, LCD screen, printers, speakers, etc.
– Communication Devices
• Enables a computer to send and receive data, instructions, and information
Note:
Some references books show the basic components of typical computer system is CPU, Main
memory, secondary memory/storage devices, input devices and output devices.

9
Computer Architecture (Cont…)
• Basic Hardware Components

System unit

Communication
devices

10
Computer Architecture
• The Organization of CPU

CPU

Instruction ALU – Arithmetic


(Input) Logic Unit

Control
Unit
Result
(Output)

Communication
devices

Input Devices
11
Computer Architecture (cont…)
System Unit (CPU)
• Comprised of:

• Control Unit
• Retrieves and decodes program instructions
• Coordinates activities of all other parts of computer

• Arithmetic & Logic Unit


• Hardware optimized for high-speed numeric calculation
• Hardware designed for true/false, yes/no decisions
Computer Architecture (cont…)
Main Memory

• It is volatile. Main memory is erased when program terminates


or computer is turned off
• Also called Random Access Memory (RAM)
• Organized as follows:
• bit: smallest piece of memory. Has values 0 (off, false) or 1
(on, true)
• byte: 8 consecutive bits. Bytes have addresses.
Computer Architecture (cont…)
Main Memory
• Addresses – Each byte in memory is identified by a unique
number known as an address.

In Figure 1-3, the number 149 is stored in the byte with the address 16, and the
number 72 is stored at address 23.
Computer Architecture (cont…)
Secondary storage

• Non-volatile: data retained when program is not running or


computer is turned off
• Comes in a variety of media:
• magnetic: floppy disk, zip disk, hard drive
• optical: CD-ROM
• Flash drives, connected to the USB port
Computer Architecture (cont…)
Input devices

• Devices that send information to the computer from


outside
• Many devices can provide input:
• Keyboard, mouse, scanner, digital camera, microphone
• Disk drives and CD-ROM
Computer Architecture (cont…)
Output devices

• Output is information sent from a computer program to


the outside world.
• The output is sent to an output device
• Many devices can be used for output:
• Computer monitor and printer
• Floppy, zip disk drives
• Writable CD drives
18
Computer Software
• Software is divided into 2 categories

Software

System Application
Software Software
Computer Software (Cont..)
SYSTEM SOFTWARE APPLICATION SOFTWARE

•Normally supplied by the •Designed to perform a specific task


manufacturer of the computer such as course registration or
banking and a general-purpose such
•Consists of utility programs and
as processor (eg. Ms Word)
operating aids that facilitate the use
and performance of the computer •May be acquired by purchasing off-
the-shelf or by designing for own
•Includes the computer’s operating
purpose (customer made)
system
•Off-the-shelf : prewritten and
•Related software that manages the
ready to use
system’s resources and control the
operations of the hardware. •Custom made : written by in-
house, consulting firm or software
house

20
Computer Software (Cont..)
Where are the application and system software?

Application Software
• users can directly understand and
use the software.
• communicate in human language
• eg. Micr. Office, notepad, prog.
lang. such C, C++, VB,Python etc.

Interpreter
• use to interpret high-level
language to low level lang.
and so on. System Software
• user will communicate with • operating system
system easily. • manage and control by
machine language
• eg. i-Mac, windows, Unix,
Linux,machine lang.

21
Programs & Programming
Languages
• A program is a set of instructions that the computer follows to
perform a task

• We start with an algorithm, which is a set of well-defined


steps.
Example Algorithm for
Calculating Area of Rectangle
Machine Language

• Although the previous algorithm defines the steps for


calculating the area of a rectangle, it is not ready to be
executed on the computer.
• The computer only executes machine language instructions.
Machine Language
• Machine language instructions are binary numbers, such as

1011010000000101

• Rather than writing programs in machine language,


programmers use programming languages.
Programs and
Programming Languages
• Types of languages:

• Low-level: used for communication


with computer hardware directly.
Often written in binary machine
code (0’s/1’s) directly.

• High-level: closer to human


language
Some Well-Known High Level
Programming Languages
From a High-level Program to an Executable File
1. Create file containing the program with a text editor.
2. Run preprocessor to convert source file directives to source
code program statements.
3. Run compiler to convert source program into machine
instructions.
4. Run linker to connect hardware-specific code to machine
instructions, producing an executable file.

• Steps 1 - 4 are often performed by a single command or button


click.
• Errors detected at any step will prevent execution of following
steps.
From a High-level Program to an Executable File

Source Code Object Code

Preprocessor Linker

Modified Executable Code


Source Code

Compiler

You might also like