Computer Programming Basic Definitions
Computer Programming Basic Definitions
Example of Supercomputers
1. The K computer was based on a distributed
memory architecture with over 80,000 compute nodes. It
was used for a variety of applications, including climate
research, disaster prevention and medical research
Personal computers (PCs) are composed of hardware and software components that
must be chosen with specific features in mind. Computer component manufactures
follows same standards so that components are compatible to each other PCs.
The case of a desktop computer houses and holds firmly all the internal components,
such as the power supply, motherboard, central processing unit (CPU), memory, disk
drives, and assorted adapter cards.
Cases are typically made of plastic, steel, or aluminum and provide the framework to
support, protect, and cool the internal components
Power supplies provide power to almost all components of the computer, from the
electricity (alternating current /AC) from the wall outlet and converts it to direct current
(DC) to supply these components.
The motherboard, also known as the system board or the main board, is the backbone
of the computer. A motherboard is a printed circuit board (PCB) that contains electrical
pathways called bus, which interconnect electronic components. These components
may be soldered directly to the motherboard. Components like mouse, printers are
connected to the motherboard through the use of ports.
The central processing unit (CPU) or the brain of the computer which is responsible for
fetching, decoding, and executing of instructions. It performs arithmetic, logical and data
transfer. It fetches
and software. The CPU interprets the instructions and outputs the information to the
monitor or performs the requested tasks.
The clock speed of CPU is measured in cycles per second, and one cycle per second is known
as 1 hertz. This means that a CPU with a clock speed of 3 gigahertz (GHz) can carry out three
thousand million (or two billion) cycles per second. The higher the clock speed a CPU has, the
faster it can process instructions.
Source: Intel.com
Understanding AMD Processor Naming Conventions
Source: techconsumerguide.com
Types of Memory
A computer might use different types of memory chips. However, all memory chips store
data in the form of bytes. A byte is a grouping of digital information and represents
information such as letters, numbers, and symbols. Specifically, a byte is a block of 8 bits
stored as either 0 or 1 in the memory chip.
Read-Only Memory
Types of ROM
The list that follows describes the types of ROM:
Types of RAM
The different types of RAM are as follows:
Adapter cards are the peripheral hardware used in computers to improve the performance
and compatibility of systems. On the motherboard, there are different kinds of expansion
slots that provide connections to the system bus for the various types of adapter cards,
allowing expansion of system performance. There are different kinds of adapter cards
and expansion slots available.
Adapter Cards
Adapter cards increase the functionality of a computer by adding controllers for specific
devices or by replacing malfunctioning ports.
Network interface card (NIC): A NIC connects a computer to a network using a
network cable.
Wireless NIC: A wireless NIC connects a computer to a network using radio
frequencies.
Video adapter: Video adapters provide video capability.
eSATA card: Adds additional internal and external SATA ports to a computer
through a single PCI Express slot.
Hard disk drive (HDD): HDDs are the traditional magnetic disk devices that have
been used for years. Their storage capacity ranges from gigabytes (GB) to
terabytes (TB).
External hard drive is a portable storage device that can be attached to a computer
through a USB or FireWire connection, or wirelessly. External hard drives typically have
high storage capacities and are often used to back up computers or serve as a
network drive.
Tape drive: Magnetic tapes are most often used for archiving data. At one time,
they were useful for backing up PCs. However, the price of HDDs has dropped,
and external HDDs are now frequently used for this purpose. However, tape
backups are still used in enterprise networks. A tape drive uses a magnetic
read/write head and removable tape cartridge. Although data retrieval using a tape
drive can be fast, locating specific data is slow because the tape must be wound
on a reel until the data is found. Common tape storage capacities vary between a
few gigabytes and many terabytes.
This section describes and identifies common cables and ports used for
connecting peripherals internally and externally on computers. Video port connects a
monitor cable to a computer. Video ports and monitor cables transfer analog signals,
digital signals, or both. Computers are digital devices that create digital signals. The digital
signals are sent to the graphics card, where they are transmitted through a cable to a
display. DisplayPort is an interface technology designed to connect high-end graphics-
capable PCs and displays, as well as home theater equipment and displays.
Digital Visual Interface (DVI) connector, is usually white and consists of as many
as 24 pins (three rows of 8 pins) for digital signals, up to 4 pins for analog signals,
and a flat pin called a ground bar.
High-Definition Multimedia Interface (HDMI) was developed specifically for
high-definition televisions. However, its digital features also make it a good
candidate for computers.
Video Graphics Array (VGA) is a connector for analog video. It has three rows
and 15 pins. It is also sometimes referred to as a DE-15 or HD-15 connector.
Radio Corporation of America (RCA) connector has a central plug with a ring
around it. RCA connectors, which are used to carry audio or video, are often found
in groups of three, where a yellow connector carries video and a pair of red and
white connectors carries left and right audio channels.
Input devices are hardware devices (usually outside the computer case) that allow input
of raw data for a computer to process, allowing users to interact with and control the
computer.
Keyboard and mouse these are the two most commonly used input devices.
Keyboards are typically used for creating text documents and emails. The mouse
is used to navigate the graphical user interface (GUI). Laptops also have
touchpads to provide built-in keyboard and mouse features. The keyboard was the
very first type of input device.
ADF/flatbed scanner these devices digitize images and documents. A
photograph or document is placed on the flat glass surface, and the scan head
then moves under the glass. The digitized image is stored as a file that can be
displayed, printed, emailed, or altered. Some of these scanners have ADFs to
support multiple-page input.
Joystick and gamepad these are input devices for playing games. Gamepads
allow the player to control movement and views with small sticks and multiple
buttons. Many gamepads also have triggers that register the amount of pressure
the player puts on them. Joysticks are often used to play flight simulation-style
games.
KVM switch (keyboard, video, and mouse switch), is a hardware device that can
be used to control more than one computer while using a single keyboard,
monitor, and mouse. For businesses, KVM switches provide cost-efficient access
to multiple servers. Home users can save space using a KVM switch to connect
multiple computers to one keyboard, monitor, and mouse. Some KVM switches
have the capability to share USB devices and speakers with multiple computers.
Touchscreens are input devices that have touch- or pressure-sensitive screens.
The computer receives instructions specific to the place on the screen the user
touches.
Barcode scanner, also called a price scanner, reads the information contained
in the barcodes affixed to most products. Barcode scanners can be handheld,
wireless, or stationary. The light source on the reader captures the barcode
image and translates the image into computer-readable content. This device is
typically used at checkout counters in stores or for determining inventory levels.
The barcode often is only a number that is used to look up information. Libraries,
for instance, affix a barcode to a book so when it is checked out, the number gets
Digital cameras are input devices that capture images and videos that can be
stored, displayed, printed, or altered.
Webcam is a video camera that can be integrated into a computer or that can be
external. Webcams are typically used for video conferencing or to stream live
video onto the Internet.
Signature pad
person uses a stylus to sign on the screen. Because the electronic signature is
legal, it is typically used to establish receipt of deliveries or to sign agreements or
contracts.
Microphone is a type of digitizer that allows users to speak into a computer and
have their voices digitized. Voice, music, or sounds can be stored on the
computer to be played back, uploaded, or emailed. This device can also be used
as input for games and communication software.
Virtual reality headsets, are devices typically used with computer games,
simulators, and training applications. They are head-mounted devices that
provide a separate image for each eye. Most headsets include head-motion and
eye-motion tracking sensors. These devices are also output devices that deliver
video and audio to the wearer.
Output devices are hardware devices that take the data processed from input and pass
on the information for use. Output devices are needed for a user to get processed data in
a usable format.
An output device takes binary information (ones and zeros) from the computer and
converts it into a form easily understood by the user.
Monitors and projectors are output devices that create visual and audio signals for the
user. Virtual reality (VR) headsets are another type of output device. Televisions may also
be output devices. Printers are visual output devices that create hard copies of computer
files.
Speakers and headphones are output devices that produce only audio signals. Output
devices make it possible for users to interact with computers.
Most monitors use one of three types of technology: LCD, LED, or OLED.
Liquid crystal display (LCD) has two polarizing filters with a liquid crystal
solution between them. An electronic current aligns the crystals so light can
pass through or not pass through, creating the image.
Light-emitting diode (LED) is an LCD display that uses LED backlighting.
LED has lower power consumption than standard LCD backlighting. The
panel is thinner, lighter, and brighter and has better contrast than LCD.
Organic LED (OLED) is a type of LED display that uses a layer of organic
material that responds to electrical stimulus to emit light. Each pixel lights
individually, resulting in much deeper black levels than are available with
LED.
Most video projectors use LCD or DLP technology.
Digital light processing (DLP) uses a spinning color wheel with an array
of mirrors. Each mirror corresponds to a pixel and reflects light toward or
away from the projector optics, creating an image of up to 1024 shades of
gray. The color wheel then adds the color data to complete the projected
image. Different projectors have different numbers of lumens, which affects
the level of brightness of the projected image. LCD projectors typically have
more lumens (are brighter) than DLP projectors. ANSI has a standardized
procedure for testing projectors. Projectors tested with this procedure are
virtual objects in the real world. Smart glasses are also AR devices. They
weigh much less than AR headsets and are often designed for a specific
audience, such as cyclists.
Printers are output devices that create hard copies of files. A hard copy might be
a on a sheet of paper. It could also be a plastic form created from a 3D printer.
These are the two main printer categories: impact and non-impact.
Impact printers work by banging a head or needle against an ink ribbon to
make a mark on the paper while n on-
Speakers are a type of auditory output device. Most computers and mobile
devices have audio support either integrated into the motherboard or on an adapter
card. Audio support includes ports that allow input and output of audio signals. The
audio card has an amplifier to power headphones and external speakers.
Headphones, earbuds, and the earphones found in headsets are all auditory
output devices. These can be wired or wireless. Some are Wi-Fi or Bluetooth
enabled.
software. Software is a collection of data or computer
instructions that tell the computer how to work. There two types of software (1) System
Software and (2) Application Software
browsing the web. For gaming, the Windows operating system is well optimized
than that of MAC.
2. While discussing the fastest OS, there is no argument that Linux based OS is the
3. Linux based OS like Ubuntu Server, CentOS server, Fedora is great options
especially for running business enterprises where substantial computing power is
mandatory.
1. MS-Windows
2. Ubuntu
3. Mac OS
4. Fedora
5. Solaris
6. Free BSD
7. Chrome OS
8. CentOS
9. Debian
10. Deepin
Application software (app for short) is a program or group of programs designed for end users.
Examples of an application include a word processor, a spreadsheet, an
accounting application, a web browser, an email client, a media player, a file viewer, simulators,
a console game or a photo editor.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
Activity #2
In this activity identify the type and classification of each software
Background
Range Calculations
Integer conversion
Fraction conversion
OBJECTIVES
DISCUSSION
There is no limit on the maximum value for the base, however, the largest known base is 16
Decimal base 10
Hexadecimal base 16
Octal base 8
Binary base 2
The base determines the range of a digit in the number system which starts with 0 and ends with
base-1
For bases with range exceeding 10, the A-Z alpha symbols are used to represent values greater
than 9
Examples
Computers internally stores and process data using the binary system
Binary is compatible with the computer hardware architecture which is based on Boolean
digital logic
Most computers use the hexadecimal or the octal number systems in programming and debugging
Advantages
Both number systems can be used as a short hand notation for binary
More readable than binary and hence easier for humans to work with
Conversion between binary and decimal is necessary to make human to machine interaction
possible
the available digits to store a number (storage size). Therefore, counting process will stop when all
the available digits are exhausted. Overflow will occur when storage size limit is exceeded. The
0 0 0 0
1 1 1 1
2 2 2 10
3 3 3 11
4 4 4 100
5 5 5 101
6 6 6 110
7 7 7 111
8 8 10 1000
9 9 11 1001
A 10 12 1010
B 11 13 1011
C 12 14 1100
D 13 15 1101
E 14 16 1110
F 15 17 1111
10 16 20 10000
Range Calculations
Examples
Examples
Integer number data unit range with storage size of 16 bits = 2 16 = 65536
Integer Conversion
Calculations is done using a tabular form of the following headings (New Base, From base
number, Remainder)
Examples
5 1224 4
5 244 4
5 48 3
5 9 4
= 1434445
16 509 13
16 31 15
= 1FD716
Convert 64 10 to binary
2 32 0
2 16 0
2 8 0
2 4 0
2 2 0
= 10000002
Digit position numbering starts from the least significant digit and ends with the most
significant digit
Examples
4-digit decimal weight calculation 103, 102, 101, 100 = 100010, 10010, 1010, 110
4-bit binary weight calculation 23, 22, 21, 20 = 810, 410, 210, 110
4-digit octal weight calculation 83, 82, 81, 80 = 51210, 6410, 810, 110
Each digit has n times the weight of its next rightmost neighbor (where n is the base)
In binary each digit has twice the weight of its next right neighbor
In decimal each digit has 10 times the weight of its next rightmost neighbor
Conversion Examples
= 4 x 80 + 5 x 81 + 7 x 82 + 3 x 83 + 1 x 84
= 4 x 1 + 5 x 8 + 7 x 64 + 3 x 512 + 1 x 4096
= 612410
= 1 x 20 + 0 x 21 + 0 x 22 + 0 x 23 + 1 x 24
= 1 + 0 + 0 + 16
= 1710
= 1 + 16 + 64
= 8110
= 13 + 48 + 1280
= 134110
Two number systems are related when one number system base is an integral power of the other
A single digit in the larger base requires n digits in the smaller base (where n is the power value)
Octal is related to binary since it takes 3 binary digits to represent 1 octal digit (23 = 8)
Hex is related to binary since it takes 4 binary digits to represent 1 hex digit (24 = 16)
Smaller base
If result exceed larger base, then the two bases are not related
Examples
22 = 4
23 = 8
Construct a conversion table (i.e. counting table as seen above is an example of conversion table)
Must start grouping from the right (i.e. least significant digit)
Examples
= 35D816
Convert 11010111011000 2 to octal
Group the number into groups of 3 digits: 11 010 111 011 000
Pad last group with zeros: 011 010 111 011 000
= 327308
Base 4 Binary
0 00
1 01
2 10
3 11
= 31131204
= 10 01 10 10 112
It is impractical to directly convert between none decimal number systems that are not related
As well, a base that is related to both bases can be used as an intermediary conversion base
Binary can be used as an intermediate conversion base to convert between hex and octal
Examples
Convert 35D816 to octal (note that the two bases are none decimal and are not related)
Convert the binary result to octal = 011 010 111 011 000
= 327302
Convert 21203 to base 5 (note that the two bases are none decimal and are not related)
intermediate base
= 2345
Fraction conversion
Fraction number conversion does not always result in an accurate result due to:
If precise conversion cannot be done, conversion will result in lose of accuracy (i.e. lose of
significant digits)
Examples
0.110 is impossibl
When converting a number that contains both integer and fraction parts
Calculations is done using a tabular form of the following headings (New Base, From base
Multiply from base number by new base repeatedly until the from base number reaches
zero
Examples
2 .65625 1
2 .3125 0
2 .625 1
2 .25 0
= .1101012
2 .2 0
2 .4 0
2 .8 1
2 .6 1
2 .2 0 repeat detected
8 .8 6
8 .4 3
8 .2 1
8 .6 4
8 .8 6 repeat detected
= .563 8
Digit position numbering starts from the most significant digit and ends with the least
significant digit
Digit position starts from 1 and ends with the number of digits
Examples
3-digit decimal weight calculation 10-3, 10-2, 10-1 = 1/100010, 1/10010, 1/1010
·3-bit binary weight calculation 2-3, 2-2, 2-1 = 1/810, 1/410, 1/210
3-digit octal weight calculation 8 -3, 8-2, 8-1 = 1/51210, 1/6410, 1/810
Examples
= .6337410
= (16 + 8 + 1) / 32 = 25 / 32
= .7812510
= .31054687510
Convert .1 3 to decimal (does not convert accurately and round up or truncation is needed)
= 1 x 1/3
= 1/3
10
Very similar to integer conversion with the following differences
Conversion start at the most significant digit (i.e. the digit to the right of the fraction point)
Examples
= .010010102
Map each digit to its equivalent binary digits = 010 011 111
= .0100111112
= .1011102
b. Smaller base to Larger base conversion
Must start grouping from the right of the fraction point (i.e. most significant fraction digit)
Examples
Group into 3 digits groups starting from the right of the binary point: 101 1
= .548
Group into 4 digits groups starting from the right of the binary point: 1011 1
= .B816
Group into 2 digits groups starting from the right of the binary point: 10 11 1
= .2324
Arithmetic in different bases
This section discusses simple arithmetic in the different bases covering only addition and
multiplication
1. Addition
Result bit is computed as XOR of the two input bits (i.e. result is 1 only if either digit is
1)
Carry bit is computed as AND of the two input bits (i.e. carry if both digits are 1)
Method
Example
2. Multiplications
Method
Use the traditional method of multiplication that you are familiar with