Uploaded by zarifahmed180

How computer works

advertisement
CSE 1110
Introduction to Computer Systems
ASSIGNMENT 01
Report: How Computer Works
Submitted By
MD. Jarif Ahmed
Student ID: 0112230383
Submitted To
Md. Muhyminul Haque
Department of CSE, UIU
Submission Date: 15th Nov, 2022
1 of 13
What is Computer and What makes a Computer, a Computer
A computer is a machine that can store and process information. Most computers
rely on a binary system, which uses two variables, 0 and 1, to complete tasks such
as storing data, calculating algorithms, and displaying information. It is
a programmable device that stores, retrieves, and processes data. The term
"computer" was originally given to humans who performed numerical calculations
using mechanical calculators, such as the abacus and slide rule. The term was later
given to mechanical devices as they began replacing human computers. Today's
computers are electronic devices that accept data, process that data, produce output
and store the results. So, we can say that a computer work like this flowchart:
2 of 13
Input: Input refers to any information, or data, that is sent to a computer for
processing. Input is often sent to the computer from a device such as a keyboard,
mouse, or other input device. Putting it simple, input is the act of entering data into
a computer. Once the data has been entered into the computer it can be processed
and whatever instruction that was commanded, can be carried out .
Storage: Storage is a process through which digital data is saved within a data
storage device by means of computing technology. Storage is a mechanism that
enables a computer to retain data, either temporarily or permanently. Storage devices
such as flash drives and hard disks are a fundamental component of most digital
devices since they allow users to preserve all kinds of information such as videos,
documents, pictures and raw data. Storage may also be referred to as computer data
storage or electronic data storage. When user input something to the computer,
storage first store it and then send it to processor to process data.
Processing: Processing is where input gets transformed into output. The
computer's Central Processing Unit (CPU) is its brain. It's responsible for executing
instructions and performing mathematical operations on the input data.
Output: Output is the final result of data processing. It can be anything from images,
video, or audio content, even the words we type using a keyboard. We can also receive the
output through a printer or a projector instead of directly through our device.
And this Four mechanism makes a computer, A Computer.
3 of 13
About Binary Data’s & Number System
What is Binary Number System?
A binary number system is one of the four types of number system. In computer
applications, where binary numbers are represented by only two symbols or digits,
0 (zero) and 1(one). The binary numbers here are expressed in the base-2 numeral
system. For example, (101)2 is a binary number. Each digit in this system is said to
be a bit. According to digital electronics and mathematics, a binary number is
defined as a number that is expressed in the binary system or base 2 numeral system.
It describes numeric values by two separate symbols; 1 (one) and 0 (zero). The base2 system is the positional notation with 2 as a radix. The binary system is applied
internally by almost all latest computers and computer-based devices because of its
direct implementation in electronic circuits using logic gates.
How Binary System presents Data?
All information stored in a computer must somehow be encoded as a sequence of 0’s
and 1’s, because all storage devices consist of a set of locations that can have one of
two possible states. One state represents 0, the other state represents 1. For example,
on a CD or DVD there are billions of locations where either small pit has been created
by a laser beam (representing a 1) or no pit exists (representing a 0). An old magnetic
tape (such as a audio cassette tape or VHS video tape) consisted of a sequence of
locations that could be magnetized with an upward or downward polarization,
representing 0 or 1. A single storage location stores a single bit (binary digit) of
information. A set of 8 bits is a byte and this is generally the smallest unit of
information a computer deals with. A byte can store (2^8 = 256) different patterns of
0’s and 1’s and these different patterns might represent different things, depending on
the context.
Numbers to Binary: If we want to store an integer then it makes sense to store the
binary representation of the integer, and in one byte we could store any of the numbers
0 through 255, with the usual binary representation. Of course many practical
problems involve integers larger than 256, and possibly negative integers as well as
positive. So in practice a single integer is generally stored using more than 1 byte. The
default for most computer languages is to use 4 bytes for an integer, which is 32 bits.
4 of 13
One bit is used to indicate whether the number is positive of negative, leaving 31 bits
to represent the values from 0 to (2^{31} = 2147483648) as well as the negatives of
these values. Actually, it’s a bit more complicated (no pun intended) since the scheme
just described allows storing both +0 and -0 and a more complicated system allows
storing one more integer, and in practice the two’s complement representation is used,
which shows a table of how the numbers -128 through 127 would actually be
represented in one byte. If we are dealing with real numbers rather than integers, a
more complicated system is needed for storing arbitrary numbers over a fairly wide
range in a fixed number of bytes. Early computers used fixed point notation in which
it was always assumed that a certain number of bits to the right of the decimal point
were stored. This does not work well for most scientific computations, however.
Instead, computers now store real numbers as floating point numbers, by storing
a mantissa and an exponent. The decimal number 5.625 could be written as (0.5625
\times 10^1) in normalized form, with mantissa 0.5625 and exponent 1. Similarly, the
binary number 101.101 in floating point form has mantissa 0.101101 and exponent 10
(the number 2 in binary, since the mantissa must be multiplied by (2^2 = 4\) to shift
the binary point by two spaces). Most scientific computation is done using 8-byte
representation of real numbers (64 bits) in which 52 bits are used for the mantissa and
11 bits for the exponent (and one for the sign). This is the standard for objects of
type float in Python. In Fortran this is sometimes called double precision because 4byte floating point numbers (single precision) were commonly used for non-scientific
applications. 8 byte floats are generally inadequate for most scientific computing
problems, but there are some problems for which higher precision (e.g. quad
precision, 16 bytes) is required. Before the 1980’s, different computer manufacturers
came up with their own conventions for how to store real numbers, often handling
computer arithmetic poorly and leading to severe problems in portability of computer
codes between machines. The IEEE standards have largely solved this problem.
Text to Binary: If we are storing text, such as the words you are now reading, the
characters must also be encoded as strings of 0’s and 1’s. Since a single byte can
represent 256 different things, text is generally encoded using one byte for each
character. In the English language we need 52 different patterns to represent all the
possible letters (one for each lower case letter and a distinct pattern for the
corresponding upper case letter). We also need 10 patterns for the digits and a
fairly large number of other patterns to represent each other symbol (e.g.
punctuation symbols, dollar signs, etc.) that might be used. A standard 8-bit
encoding is UTF-8. This is an extension of the earlier standard called ASCII,
which only used 7 bits. For encoding a wider variety of symbols and characters
(such as Chinese, Arabic, etc.) there are standard encodings UTF-16 and UTF-32
5 of 13
using more bits for each character. Obviously, in order to interpret a byte stored in
the computer, such as 01001011 properly, the computer needs to know whether it
represents a UTF-8 character, a 1-byte integer, or something else.
Colors to Binary: Another thing a string of 0’s and 1’s might represent is a color,
for example one pixel in an image that is being displayed. Each pixel is one dot of
light and a string of 0’s and 1’s must be used to indicate what color each pixel
should be. There are various possible ways to specify a color. One that is often used
is to specify an RGB triple, three integers that indicate the amount of Red, Green,
and Blue in the desired color. Often each value is allowed to range from 0
(indicating none) to 255 (maximal amount). These values can all be stored in 1 byte
of data, so with this system 3 bytes (24 bits) are used to store the color of a single
pixel. The color red, for example, has maximal R and 0 for G and B and hence has
the first byte 256 and the next two bytes 0 and 0.
6 of 13
Circuits & Different Logics Generally Used in
Computers
Logic Gates and how They Works:
A logic gate is a device that acts as a building block for digital circuits. They perform
basic logical functions that are fundamental to digital circuits. Most electronic
devices we use today will have some form of logic gates in them. The basic logic
gates are categorized into seven types as AND, OR, XOR, NAND, NOR, XNOR,
and NOT. These are the important digital devices, mainly based on the Boolean
function. Logic gates are used to carry out the logical operations on single or multiple
binary inputs and result in one binary output.
And Gate: The And gate takes two (or more) inputs and gives out a 1
(HIGH/true) if all the inputs are 1. Otherwise, it gives out a 0 (LOW/false). The
truth table is below, but all you really need to remember is that the AND gate
needs a 1 on input A and input B to give out 1.
Not Gate: The simplest logic gate of all is the Not gate. It takes one bit as input (A).
And it gives as an output (Q) what is NOT on the input. So, if there is a 1 on the
input, its output is 0. And if there is 0 on the input, its output is 1. It’s also called
an inverter.
7 of 13
Or Gate: The Or gate takes two (or more) inputs and gives out a 1 if any of the
inputs are 1. Otherwise, it gives out a 0. The truth table is below, but all you really
need to remember is that the OR gate needs a 1 on input A or input B to give out 1.
How Circuits Used in Computer:
Computer circuits are binary in concept, having only two possible states. They use
on-off switches (transistors) that are electrically opened and closed in nanoseconds
and picoseconds (billionths and trillionths of a second). A computer's speed of
operation depends on the design of its circuitry. Circuits made with a lot of logic
gate. We can say circuit is a combination of logic gates. Billions of operations
happened in a second inside a circuit.
8 of 13
Different Components of a computer
A computer works with different parts. There are a cpu, memory, input devices,
output devices in a computer. Those parts do different things for the user like input
devices take data and instructions from the user. CPU process the data and store it
in memory. Then memory sent it to the output devices and the output devices shows
the result to the user.
CPU (Central Processing Unit):
The computer does its primary work in a part of the machine we cannot see, a control
center that converts data input to information output. This control center, called the
central processing unit (CPU), is a highly complex, extensive set of electronic
circuitry that executes stored program instructions. All computers, large and small,
must have a central processing unit. As Figure 1 shows, the central processing unit
consists of two parts: The control unit and the arithmetic/logic unit. Each part has a
specific function.
The Control Unit
The control unit of the CPU contains circuitry that uses electrical signals to direct
the entire computer system to carry out, or execute, stored program instructions.
Like an orchestra leader, the control unit does not execute program instructions;
rather, it directs other parts of the system to do so. The control unit must
communicate with both the arithmetic/logic unit and memory.
The Arithmetic/Logic Unit
The arithmetic/logic unit (ALU) contains the electronic circuitry that executes all
arithmetic and logical operations. The arithmetic/logic unit can perform four kinds of
arithmetic operations, or mathematical calculations: addition, subtraction,
multiplication, and division. As its name implies, the arithmetic/logic unit also
performs logical operations. A logical operation is usually a comparison. The unit can
compare numbers, letters, or special characters. The computer can then take action
based on the result of the comparison. This is a very important capability. It is by
comparing that a computer is able to tell, for instance, whether there are unfilled
seats on airplanes, whether charge- card customers have exceeded their credit
limits, and whether one candidate for Congress has more votes than another.
9 of 13
Memory and Storage:
Memory is also known as primary storage, primary memory, main storage, internal
storage, main memory, and RAM (Random Access Memory); all these terms are used
interchangeably by people in computer circles. Memory is the part of the computer
that holds data and instructions for processing. Although closely associated with the
central processing unit, memory is separate from it. Memory stores program
instructions or data for only as long as the program they pertain to is in operation.
Keeping these items in memory when the program is not running is not feasible for
three reasons:
•
•
•
Most types of memory only store items while the computer is turned on; data is
destroyed when the machine is turned off.
If more than one program is running at once (often the case on large computers
and sometimes on small computers), a single program can not lay exclusive
claim to memory.
There may not be room in memory to hold the processed data.
Input Devices:
An input device is any hardware device that sends data to a computer, allowing you
to interact with and control it. Examples of input devices include keyboards, mouse,
scanners, cameras, joysticks, and microphones. The most commonly used or primary
input devices on a computer are the keyboard and mouse. However, there are other
devices that input data into a computer. As far as other input devices, it depends on
what was included with your computer and what's connected to the computer. Today,
input devices are important because they are what lets you interact with and add new
information to a computer. For example, if a computer had no input devices, it could
run by itself but there would be no way to change its settings, fix errors, or other
various user interactions. Also, if you wanted to add new information to the
computer (e.g., text, command, document, picture, etc.), you wouldn't be able to do
so without an input device.
10 of 13
Output Devices:
An output device is a piece of computer hardware that receives data from a computer
and then translates that data into another form. That form may be audio, visual,
textual, or hard copy such as a printed document. The key distinction between an
input device and an output device is that an input device sends data to the computer,
whereas an output device receives data from the computer. Here is some example of
output devices: 1. Monitor · 2. Projector · 3. Video Card · 4. GPS · 5. Printer · 6.
Braille Reader · 7. Speaker/Headphones · 8. Sound Card.
11 of 13
Software & How It Interacts with Hardware
What is Software:
Software is a set of instructions, data, or programs used to operate a computer and
execute specific tasks. In simpler terms, software tells a computer how to function.
It’s a generic term used to refer to applications, scripts, and programs that run on
devices such as PCs, mobile phones, tablets, and other smart devices. Software
contrasts with hardware, which is the physical aspects of a computer that perform
the work. Without software, most computers would be useless. For example, a web
browser is a software application that allows users to access the internet.
An operating system (OS) is a software program that serves as the interface between
other applications and the hardware on a computer or mobile device. TCP/IP is built
into all major operating systems to allow computers to communicate over long
distance networks. Without the OS or the protocols built into it, it wouldn’t be
possible to access a web browser. The majority of software is written in high-level
programming languages due to the language being closer to natural human
language as opposed to machine language. The high-level language is then
translated into low-level machine code using a compiler or interpreter for the
computer to understand. Software can also be written in a low-level assembly
language, but it is less common.
How Software Interact with Hardware:
Hardware and software interact as a computer processes data. Software is
programming code written to provide instructions to the hardware so that you can
perform specific tasks. Using input devices, you interact with the software by typing
commands, selecting an option from a menu, or clicking a button for example. And
the operating system helps the other software to interact with hardware.
12 of 13
Conclusion
The functions of a computer is very complex but it is very interesting though. It
can do tons of calculations in millisecond. There is another type of language made
for the computer. Computer only use binary numbers to process and store different
types of data. There is a lot of circuits made with millions and billions logic gates
inside the processor of a computer. Computer use different types of devices to do
different jobs. And the most important thing of a computer is interaction of its
software and hardware. Computers are getting upgrades day by day and solving the
most complex problem for us and makes our life easy.
13 of 13
Download