IT 112 Notes
IT 112 Notes
Preliminary Concepts
1. Hardware
a. The Central Processing Unity
- The “brain” of the computer.
- Receives input data, executes instructions, and processes information
- Communicates with I/O devices
- Contains millions of tiny electrical parts
- Kept cool using appropriate fans or ventilation systems, and are covered with heat sinks and thermal
past
- CPU relies on a chipset to control instruction and the flow of data to and from other parts of the
computer.
- Control Unit and the Arithmetic Logic Unit (ALU)
- Relies on the system clock, memory, secondary storage, and the data address buses.
- Contains internal memory units that are called registers
- Registers contain data, instructions, counters and addresses used in the processing by the ALU
- The first microprocessor was released by Intel in Nov. 1971
- Oldest intel 4004 processor performs 60k operations per sec while a modern intel Pentium can perform
abut 188 million instructions per second
- Extracts instructions from memory - Digital circuit inside the processor that
and decodes and executes them handles arithmetic and logical operations
- Acts as an intermediary that by loading data from input registers
decodes the instructions sent to the - After the control unit provides the ALU
processor with the instruction on the operations that
- Tells other units such as the ALU must be performed, the ALU completes
what to do them by connecting multiple transistors,
- Sends back the processed data back and then stores the results in an output
to memory register.
1.2 Memory
- Stores data and instructions needed by the CPU
- Divided into several storage locations
1.2.1 Main Memory
- Very closely connected to the processor.
- Hold programs and data that the processor is actively working with
- Not used for long-term storage
- Sometimes called the RAM (Random Access
Memory)
- The computer’s main memory is considered Volatile storage – Once the computer is
as a volatile storage turned off, all info residing in the main
memory is erase
1.2.2 The Secondary Memory
- Connected to the main memory Non-Volatile – The info in the secondary
- Hold programs and data for long term use memory is not erased when the PC is turned
off
- Examples are the SSD, Hard Disks, Flash Drives, and Optical discs (CD, DVD, etc)
- Considered as non-volatile storage
2. Software
- Program that a PC uses in order to function
- Kept on some hardware device, but it is intangible.
- Programs act like instructions for the processor
a. System Programs
- Programs that are needed to keep all the hardware and software systems running together smoothly
- OS like Linux, Windows, Unix, Solaris, MacOS
b. Application Programs
- Programs that people use to get their work done
- Examples: Word Processor, Game Programs
c. Programming Languages
- Used to write programs, scripts, and instructions which can be executed by a computer
- Can be used to construct computer programs and OS.
- JAVA, C, C++ are examples
- The Computer understands only one language which is called the machine language
- Machine language is in the form of ones and zeros
- User-friendly
- Forms of statements easily understood by a human being
- Java, C, C++
Program Translation
- Program translation is the conversion of a program (called the “source” code) written in some
programming language to its equivalent program (called “executable”, or “object” code) in the machine
language of a target computer.
a. Compilers
- Compilers are program translators that convert the entire source code of a program written in a high-
level programming language (like C, C++, or Java) into machine code or intermediate code.
- No output is executed
b. Interpreter:
- Interpreters translate and execute code line-by-line or statement-by-statement in real-time. They do not
produce a separate executable file; instead, they directly execute the source code. Languages like Python
and JavaScript often use interpreters.
c. Assemblers
- It converts assembly language to the machine language equivalent. This can be likened to a compiler for
assembly language.
a. Problem definition
- A programmer receives a problem to solve as a task.
- Before creating a program to solve the problem, it's essential to clearly define the problem.
- The problem definition should include specific input and output requirements.
- A well-defined problem is considered a significant part of finding a solution.
- Computer programming starts with the precise definition of the problem to be addressed.
b. Problem Analysis
- After the problem has been well-defined, the simplest approach to solve the problem must be
formulated
- This step involves breaking up the problem into smaller and simpler sub-problems
c. Algorithm design and representation
- Once the problem is defined, it is now time to find a solution
- Normally required to solve in a step-by-step manner
- Algorithm is a clear specification of the steps need to solve a problem
- Can be expressed in either human language, flowchart, or pseudocode.
Pseudocode is a simplified, human-readable description of a computer program or algorithm that uses plain language
and simple conventions to outline its logic and steps. It is used for planning and communication in software
development, focusing on algorithmic ideas rather than specific programming language syntax.
d. Coding and Debugging
- The programmer has to add some fixes to the program in case of errors (also called bugs) that occur in
the program. This process is called debugging.
- Two types of error that a programmer will encounter. First is compile time error and the other is runtime
error
- Compile-Time Error occurs if there is a syntax error in the code
- A runtime error is an error that occurs while a computer program is running. It happens when the
program encounters a problem or unexpected situation that it doesn't know how to handle. This can
result from various issues, such as dividing by zero, trying to access a file that doesn't exist, or using a
variable that hasn't been properly initialized.