Data Conversion in Computer Systems
Data Conversion in Computer Systems
Data conversion is the transformation of computer data from one format to another.
Registers
It can also be defined as a special, high-speed storage area within the CPU.
Registers are not part of the memory; but rather, they are additional storage locations that offer the
advantage of speed. Register works under the direction of the control unit to accept, hold and transfer
instruction or data and perform arithmetic or logical comparison at high speed. Registers are the fastest
memory available for use in the PC because they are hard-wired right into the processor logic.
Address
A memory address is an identifier for a memory location at which a computer program or a hardware
device can store data and later receive it.
Bus
A bus is a set of physical connections (cables, printed circuits, etc.) which can be shared by multiple
hardware components to communicate with one another. The purpose of buses is to reduce the
number of "pathways" needed for communication between components, by carrying out all
communications over a single data channel. This is why the metaphor of a "data highway" is sometimes
used. If only two hardware components communicate over the line, it is called a hardware port (such as
a serial port or parallel port).
A bus is characterized by the amount of information that can be transmitted at once. This amount,
expressed in bits, corresponds to the number of physical lines over which data are sent simultaneously.
A 32-wire ribbon cable can transmit 32 bits in parallel. The term, "width" refers to the number of bits a
bus can transmit at once. In addition, the bus speed is also defined by its frequency (expressed in Hertz),
the number of data packets sent or received per second. Each time that data is sent or received is called
a cycle. This way, it is possible to find the maximum transfer speed of the bus, the amount of data which
it can transport per unit of time, by multiplying its width by its frequency.
Example: What is the speed of a bus with a width of 16 bits and a frequency of 133 MHz?
Solution
Internal Bus: The internal bus (sometimes called the front-side bus, or FSB for short). The internal bus
allows the processor to communicate with the system's central memory (the RAM).
Expansion Bus: The expansion bus (sometimes called the input/output bus) allows various motherboard
components (USB, serial, and parallel ports, cards inserted in PCI connectors, hard drives, CD-ROM and
CD-RW drives, etc.) to communicate with one another. However, it is mainly used to add new devices
using what are called expansion slots connected to the input/output
Address bus: carries memory addresses from the processor to other components such as primary
storage and input/output devices. The address bus is unidirectional, that is, data only move in one
direction.
Data bus: carries the data between the processor and other components. The data bus is bidirectional,
that is, data can move in two directions (to and fro simultaneously)
Control bus: carries control signals from the processor to other components. The control bus also carries
the clock's pulses. The control bus is unidirectional, that is, data only move in one direction.
There are many types of registers; some of them are examined below:
Memory Data Register (MDR): This register contains the data to be stored in the computer storage or
the data after a fetch from the computer storage.
Current Instruction Register (CIR): CIR stores the instruction currently being executed or decoded.
Memory Address Register (MAR): MAR holds the memory address of data and instruction.
Program Counter (PC): PC is commonly called instruction pointer (IP) and sometimes called instruction
address register. It is a register that holds the address of the memory location of the next instruction
when the current instruction is executed by the microprocessor.
Accumulator Register: This register is used for storing the results that are produced by the system.
Functions of Registers
i.Registers hold the address of memory where the CPU wants to read or write data
ii. They hold the contents of data instruction read from or written in memory
iv. Registers are used for exchanging data between the I/O module and the processor
vi. Registers allow the bits of its content to be moved to left or right (shift register)
vii.They hold the memory addresses of data and instructions during the execution phase
Registers are located inside the processor Main memory is located outside the processor
Fetch-Execute Cycle
The fetch-execute cycle is the sequence the computer follows to transform data from one format to
another.
Fetch the next instruction: The program counter contains the address of the next instruction to be
executed; the control unit goes to the address in the memory specified in the program counter, makes a
copy of the contents and places the copy in the instruction register.
Decode the Instruction: To execute the instruction in the instruction register, the control unit has to
determine what the instruction is.
Get Data If Needed: It may be that the instruction to be executed requires additional memory accesses
to complete its task. If this is the case, the control unit must get the content of the memory location.
Execute the Instruction: Once an instruction has been decoded and any data fetched, the control unit is
ready to execute the instruction. Execution involves sending signals to the arithmetic/logic unit to carry
out the processing. When the execution is complete, the cycle begins again.
i. The amount of RAM: The larger the size of the computer RAM the faster the speed of data transfer
and vice versa.
ii. The speed and generation of your CPU (the system clock): The speed of the computer is measured in
Hertz (Hz) which is the number of tasks it can process per second. A computer with a specification 2GHz
can process 2 billion tasks in one second. This implies that the faster the speed of the computer the
faster the speed of data transfer.
iii. The size of the Register on your CPU: The speed of data transfer will be faster if the size of the
register is also large and vice versa.
iv. The Bus width: The larger the width of a bus, the faster the number of bits that bus can transmit at
once.
v. The Bus speed: High bus speed will favour faster speed of data transfers
vi. The amount of Cache memory: Cache memory is a temporary memory that holds frequently accessed
data and instructions for faster and more efficient processing by the CPU. The higher the size of cache
memory the faster the speed of data transfer. The downside of the cache memory is that it trades off
capacity for speed.
Class: SSS Three
Definition of Security
Data security is the practice of keeping data protected from corruption and unauthorized access.
1. Viruses, Worms and Trojan horses: Viruses, worms and Trojan Horses are all malicious programs that
can cause damage to your computer, but there are differences among the three, and knowing those
differences can help you to better protect your computer from their often damaging effects.
a. Virus: A computer virus attaches itself to a program or files so it can spread from one computer to
another, leaving infections as it travels. It is important to note that a virus cannot be spread without a
human action, (such as running an infected program) to keep it going.
b. Worms: Worms spread from computer to computer, but unlike a virus, they can travel without any
help from a person. A worm takes advantage of file or information transport features on your system,
which allows it to travel unaided
c. Trojan horse: It is a destructive program that looks like a genuine application. Unlike viruses, Trojan
horses do not replicate themselves but they can be just as destructive. Trojans also open a backdoor
entry to your computer which gives malicious users/programs access to your system, allowing
confidential and personal information to be theft.
4. Carelessness-giving out personal and vital information on the net without careful screening
Preventive Measures
2. Use of firewall: A firewall is a software utility or hardware device that acts as a filter for data entering
or leaving a network or computer.
Ethics
Ethics is a set of moral principles that govern the behaviour of a group or individual. Therefore,
computer ethics is a set of moral principles that regulate the use of computers
Legal Issues
Legal issues are the number of issues related to the use and misuse of ICT and its related fields.
1. Intellectual property right: Intellectual property refers to creations of the mind. A right that is had by a
person or by a company to have exclusive rights to use its plans, ideas, or other intangible assets
without the worry of competition, at least for a specific period. These rights can include copyrights,
patents, trademarks, and trade secrets
2. Piracy: Software piracy is the illegal copying, distribution, or use of the software.
Etc
1. A computer file is defined as the smallest meaningful unit of data representation within a computer.
2. A computer file is a block of arbitrary information, or resource for storing information, which is
available to a computer program and usually on some kind of durable storage.
File Contents
On the atomic level, all the information in a file is binary, or just a series of ones and zeros. A computer
file may contain;
ii. Program: Program files contain instructions for the computer’s microprocessor.
iii. Data: Data files include all other files that aren’t programs or documents.
File Functions
c. They store data used by the users such as Microsoft Word files.
2. Field: Field is a single piece of information about an object. A is also defined as a space that holds
specific parts of data from a set or a record. Examples of fields are NAME, ADDRESS, QUANTITY, AGE,
etc.
4. Data item: Data item is the actual data stored in the field
Numeric data: Data consisting of digits and not letters of the alphabet or special characters.
Alphabetic data: Data consisting of letters and not digits or special characters.
File Organization
The term "file organization" refers to how data are stored in a file and, consequently, the method by
which it can be accessed.
a. Block: A block is the physical unit of transfer between the backing store and the main memory.
b. Bucket: A bucket is the logical unit of transfer between the backing store and the main memory.
c. Hit: A hit is the number of times a program or item of data has been accessed.
Explanation
Serial file organization
Serial files are stored in chronological order, that is, as each record is received it is stored in the next
available storage position. In general, it is only used on a serial medium such as magnetic tape.
Sequential files are files whose records are sorted and stored in ascending or descending on a particular
key field.
Indexed Sequential file organization is logically the same as a sequential organization, but an index is
built indicating the block containing the record with a given value for the Key field. An index is an
alphabetical list of names, subjects, etc., with references to the places where they occur,
A randomly organized file contains records arranged physically without regard to the sequence of the
primary key. Records are loaded to disk by establishing a direct relationship between the Key of the
record and its address on the file, normally by use of a formula (or algorithm) that converts the primary
Key to a physical disk address. This relationship is also used for retrieval.
a. Serially
b. Sequentially and
c. Randomly
File Classification
a. Transaction Files: transaction files contain details of all activities that have occurred in the last period.
Examples of transaction files are the price of the products, customers' orders for the products, inserting
new data into the database etc.
b. Master Files: Master files are permanent files kept up-to-date by applying the transactions that have
occurred during the operation of the business. E.g. customer ledgers, and student databases.
c. Reference Files: Reference files are the type of master file containing referential data. They contain
data that are necessary to support data processing e.g. price lists, dictionary files, present value
schedules, table of inventory codes or categories, lookup tables
2. How many records are processed each time the file is updated
4. nature of content
5. Organization method
6. Storage medium
Basic File Operations
4. Copy: To produce a file so that it is the same as the original piece of work
6. Update: A manipulation involving adding, modifying, or deleting data to bring a file up-to-date
There are many ways to organize data in a sequential file. One way is by using BASIC Programming
Language.
1. Choose a DOS file name: A DOS file name is a string consisting of a base name of at most eight
characters followed by an optional extension consisting of a period and at most three characters. Blank
spaces are not allowed. Some examples of DOS file names are INCOME.86, CUSTOMER.DAT. And
FORT500.
2. Choose a number from 1 through 255 to be the reference number of the file: While the file is used, it
will be identified by this number. 3. Execute the statement. OPEN file name FOR OUTPUT AS #n. Where
n is the reference number.
5. After all the data have been recorded in the file, execute CLOSE #n
Example 1: A program to demonstrate the use of WRITE statement
CLS
WRITE “ENIAC”
WRITE 1946
LET a$ = “Eckert”
LET b$ = “Mauchly”
END
[run]
output
ENIAC
1946
ENIAC 1946
Example 2: Write a program to create a file EXAMFILE.DAT with marks in English and Mathematics.
LOOP
CLOSE #1
DATA EOD, 0, 0
END
Data stored in a sequential file can be accessed and read in order with the following steps:
1. Choose a number from 1 to 255 to be the reference number for the file
2. Execute the statement. OPEN filename FOR INPUT AS n. where n is the reference number
4. After the desired items have been found close the file with the statement CLOSE #n.
Solution
LOOP
CLOSE #1
END
File Insecurity
File security is a feature of a file system which controls which users can access which files, and places
limitations on what users can do to it. If these measures are not put in place, files would be insecure.
(i) Use of backups: This refers to making copies of data so that these additional copies are used to
restore the original after the loss event. It is also a method of making copies of the file in a separate
location so that they can be restored if something happens to the computer. This can be done by using
removable media such as a rewritable CD, memory card, flash etc.
(ii) The use of antivirus: A virus is a self–replicating program that copies itself and that can infect other
programs by modifying them or their environment. An anti-virus is software designed to detect and
destroy computer viruses.
(iii) The use of password: A password is a string of characters used for authenticating a user on a
computer system. It can prevent people from accessing a computer system, account files or parts of files
by requiring a user to enter a password.
(iv) Proper label of storage device: You should label your storage devices like floppies, CDs, DVDs, Pen
drivers etc. So that you know what is exactly stored in them and so as not to accidentally delete or
format them.
(v) File management: file management is the process of maintaining folders, documents and multimedia
into categories and subcategories as desired by a user.
DIfferences Between Computer files and Manual Files
Computer files are transferred electronically. Manual files can be transported through physical means
Computer files are difficult to destroy and can last for a long time Manual files can warn off and
can be depleted easily by hand
Large amount of information can be stored and transferred It is difficult to store a large amount of
information manually