KEMBAR78
B.Tech CSE Semester I Assignment | PDF | Computer Data Storage | Computer Memory
0% found this document useful (0 votes)
67 views17 pages

B.Tech CSE Semester I Assignment

Uploaded by

Vandana Dulani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views17 pages

B.Tech CSE Semester I Assignment

Uploaded by

Vandana Dulani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Do B.Tech.

(Computer Science and


Engineering) The image cannot be display ed. Your computer may not hav e enough memory to open the image, or the
image may hav e been corrupted. Restart y our computer, and then open the file again. If the red x still
appears, y ou may hav e to delete the image and then insert it again.

Semester:I
Subject: CPLT (DCO 013A)

Assignment #1

SECTION A (2*5=10 Marks)


1. What is a Computer?
A computer is an electronic device that manipulates information, or data. It has the ability to store,
retrieve, and process data. Modern digital electronic computers can perform generic sets of
operations known as programs. These programs enable computers to perform a wide range of tasks.
You can use a computer to type documents, send email, play games, and browse the Web.

2. Write five characteristics of Computer?


Speed
A computer works with much higher speed and accuracy compared to humans while performing
mathematical calculations. Computers can process millions (1,000,000) of instructions per second.
The time taken by computers for their operations is microseconds and nanoseconds.
Accuracy
Computers perform calculations with 100% accuracy. Errors may occur due to data inconsistency or
inaccuracy.
Diligence
A computer can perform millions of tasks or calculations with the same consistency and accuracy. It
doesn't feel any fatigue or lack of concentration. Its memory also makes it superior to that of human
beings.
Versatility
Versatility refers to the capability of a computer to perform different kinds of works with same
accuracy and efficiency.
Reliability
A computer is reliable as it gives consistent result for similar set of data i.e., if we give same set of
input any number of times, we will get the same result.

3. What is cyclic code?


In coding theory, a cyclic code is a block code, where the circular shifts of each codeword gives
another word that belongs to the code. They are error-correcting codes that have algebraic properties
that are convenient for efficient error detection and correction.

4. What is non-impact printer?


Non-impact printers form characters and images without direct physical contact between the printing
mechanism and the paper. For example, inkjet printers spray tiny drops of ink onto the page, while
laser printers have a cylindrical drum that rolls electrically charged ink onto the paper.

5. Find 16's complement of A92?


SECTION B (7*3=21)
1. What is memory hierarchy? Explain the working of Control Unit by a suitable diagram. (3+4)
Memory hierarchy is about arranging different kinds of storage devices in a computer based on
their size, cost and access speed, and the roles they play in application processing. The main
purpose is to achieve efficient operations by organizing the memory to reduce access time while
speeding up operations.

The Control Unit is the part of the computer’s central processing unit (CPU), which
directs the operation of the processor. It was included as part of the Von Neumann
Architecture by John von Neumann. It is the responsibility of the control unit to tell
the computer’s memory, arithmetic/logic unit, and input and output devices how to
respond to the instructions that have been sent to the processor. It fetches internal
instructions of the programs from the main memory to the processor instruction
register, and based on this register contents, the control unit generates a control
signal that supervises the execution of these instructions. A control unit works by
receiving input information which it converts into control signals, which are then
sent to the central processor. The computer’s processor then tells the attached
hardware what operations to perform. The functions that a control unit performs are
dependent on the type of CPU because the architecture of the CPU varies from
manufacturer to manufacturer.
Examples of devices that require a CU are:
• Control Processing Units(CPUs)
• Graphics Processing Units(GPUs)

2. Convert following into binary: (2+2+3)


(a) (AF9)₁₆=(?)₂

(b) (701)₈=(?)₂
(c) (1024.50)₁₀=(?)₂
3. (a)Explain BCD code with example? (3)

(b) Explain primary and secondary memory with suitable examples? (4)
Computer Memory– Memory is storage part in computer. It is store the data, information, programs during processing
in computer. It stores data either temporarily or permanent basis. Memory used to important role in saving and retrieving
data.

Types of Memory– Mainly computer have two types memory

1. Primary Memory / Volatile Memory.


2. Secondary Memory / Non Volatile Memory.

1. Primary Memory / Volatile Memory– Primary memory is internal memory of the computer. It is also known as
main memory and Temporary memory .Primary Memory holds the data and instruction on which computer is currently
working. Primary Memory is nature volatile. It means when power is switched off it lost all data.
Types of Primary Memory– Primary memory is generally of two types.

1. RAM
2. ROM

1. RAM (Random Access Memory) – It stands for Random Access Memory.RAM is known as read /writes memory. It
generally refereed as main memory of the computer system. It is a temporary memory. The information stored in this
memory is lost as the power supply to the computer is switched off. That’s why RAM is also called “Volatile Memory”
Types of RAM– RAM is also of two types:

a) Static RAM- Static RAM also known as SRAM ,retain stored information as long as the power supply is ON. SRAM
are of higher coast and consume more power .They have higher speed than Dynamic RAM
b)Dynamic RAM– Dynamic RAM also known as DRAM, its stored information in a very short time (a few
milliseconds) even though the power supply is ON. The Dynamic RAM are cheaper and moderate speed and also they
consume less power.

2. ROM (Read Only Memory) – It stands for Read Only Memory.ROM is a Permanent Type memory. Its content are
not lost when power supply is switched off. Content of ROM is decided by the computer manufacturer and permanently
stored at the time of manufacturing. ROM cannot be overwritten by the computer. It is also called “Non-Volatile
Memory”.

Type of ROM: ROM memory is three types names are following-

1. PROM(Programmable Read Only Memory)-PROM chip is programmable ROM.it is PROM chips to write data
once and read many.once chip has been programmed ,the recorded information cannot be changed. PROM is also
nonvolatile memory.
2. EPROM (Erasable Programmable Read Only Memory)- EPROM chip can be programmed time and again by
erasing the information stored earlier in it. Information stored in EPROM exposing the chip for some time
ultraviolet light .
3. EEPROM (Electrically Erasable Programmable Read Only Memory)-The EEPROM is programmed and
erased by special electrical waves in millisecond. A single byte of a data or the entire contents of device can be
erased.

2. Secondary Memory / Non Volatile Memory– Secondary Memory is external memory of the computer. It is also
known as Auxiliary memory and permanent memory. It is used to store the different programs and the information
permanently. Secondary Memory is nature non volatile. It means data is stored permanently even if power is switched
off.
The secondary storage devices are:

1. Floppy Disks
2. Magnetic (Hard) Disk
3. Magnetic Tapes
4. Pen Drive
5. Winchester Disk
6. Optical Disk(CD,DVD)

Differences between Primary and Secondary Memory

S.N. Primary memory Secondary memory


1 Primary memory is temporary Secondary memory is permanent
Primary memory is directly accessible by
2 Secondary memory is not directly accessible by CPU
Processor/CPU
Nature of Parts of Primary memory varies. RAM-
3 It’s always Non-volatile in nature
volatile in nature. ROM- Non-volatiler
Primary memory devices are more expensive than Secondary memory devices are less expensive when
4
secondary storage devices compare to primary memory devices
The memory devices used for primary memory are The secondary memory devices are magnetic and
5
semiconductor memories optical memories
Primary memory is also known as Main memory or Secondary memory is also known as External memory
6
Internal memory or Auxiliary memory
Examples: RAM, ROM, Cache memory, PROM, Examples: Hard Disk, Floppy Disk, Magnetic Tapes
7
EPROM, Registers etc etc

SECTION C (11*3=33 Mark)


1. (a) Explain ASCII code. Find ASCII value of A-G and a-g. (3+4)
ASCII Stands for American Standard Code for Information Interchange (pronounced ‘as-key’). This
is a standard set of characters understood by all computers, consisting mostly of letters and numbers
plus a few basic symbols such as $ and %. Which employs the 128 possible 7-bit integers to encode
the 52 uppercase and lowercase letters and 10 numeric digits of the Roman alphabet, plus
punctuation characters and some other symbols. The fact that almost everyone agrees on ASCII
makes it relatively easy to exchange information between different programs, different operating
systems, and even different computers.
In ASCII, each character has a number which the computer or printer uses to represent that character.
For instance, a capital A is number 65 in the code. Although there are 256 possible characters in the
code, ASCII standardizes only 128 characters

(b)explain the use of 2`s complement with example. (4)


Two's complement is the most common method of representing signed (positive, negative, and
zero) integers on computers,[1]and more generally, fixed point binary values. Two's complement
uses the binary digit with the greatest place value as the sign to indicate whether the binary number
is positive or negative. When the most significant bit is 1, the number is signed as negative; and
when the most significant bit is 0 the number is signed as positive.

Procedure
Two's complement is achieved by:

Step 1: starting with the equivalent positive number.


Step 2: inverting (or flipping) all bits – changing every 0 to 1, and every 1 to 0;
Step 3: adding 1 to the entire inverted number, ignoring any overflow. Accounting for overflow will
produce the wrong value for the result.
For example, to calculate the decimal number −6 in binary:

Step 1: +6 in decimal is 0110 in binary; the leftmost significant bit (the first 0) is the sign (just 110 in
binary would be -2 in decimal).
Step 2: flip all bits in 0110, giving 1001.
Step 3: add the place value 1 to the flipped number 1001, giving 1010.

2. (a) Explain gray code and excess-3 code. (5)

Gray Code
The Gray Code is a non-weighted code and is cyclic as well. It is referred to as cyclic because successive
code words in this code differ by only one bit-position i.e., it is a unit distance code. It is also reflective. In
many practical applications such as analog to digital conversion, unit distance codes are used.

Conversion of Binary Code into Gray Code

To convert Binary Code into Gray Code, one should have knowledge of truth table of XOR Gate which is
as,

Now, the MSB of the binary number is copied as it is and then we perform XOR operation for consecutive
bits in a pair of two.

Example 1: Convert (1001)2 into Gray Code


Solution

Therefore, (1001)2 = (1101)g in gray code.


Excess-3 Code
Excess-3 Code is a non-weighted BCD (8421) Code. Excess-3 Code is derived from 8421 code by adding
0011 (3) to all code groups. It is a sequential code, thus can be also used for performing arithmetic
operations. Also, Excess-3 codes are self-complementing codes in nature. Therefore, subtraction by the
method of complement addition is more direct in the XS-3 code than in 8421 BCD code. Like, BCD code,
it also has six invalid states which are: 0000, 0001, 0010, 1101, 1110 and 1111.

The relationship between decimal numbers, binary numbers, and XS-3 numbers can be given as,

Decimal Numbers Binary Numbers Excess-3 Code (Binary Number + 0011)

0 0000 0011

1 0001 0100

2 0010 0101

3 0011 1100

4 0100 0111

5 0101 1000

6 1010 1001
7 0111 1010

8 1000 1011

9 1001 1100

Example: Represent (1548)10 in Excess-3 notation.


Solution
1 = 0001 + 0011 = 0100 5 = 0101 + 0011 = 1000
4 = 0100 + 0011 = 0111 8 = 1000 + 0011 = 1011

Therefore, (1548)10 = 0100 1000 0111 1011 in XS-3 form.

(b) Convert the following binary code into its equivalent gray code : (2+2+2)
(i) 1111

To convert a binary number to Gray code, you can use the following algorithm:

1. Keep the leftmost (most significant) bit of the Gray code the same as the leftmost bit of the binary number.
2. For each subsequent bit, calculate it as the XOR (exclusive OR) of the corresponding binary bit and the bit to
its left.

Let's convert the binary number 1111 to Gray code:

• Binary: 1 1 1 1
• Gray: 1 (1⊕1) (1⊕1) (1⊕1)

• The leftmost bit remains the same: 1.
• For the second bit, 1 ⊕ 1 = 0.
• For the third bit, 1 ⊕ 1 = 0.
• For the fourth bit, 1 ⊕ 1 = 0.

So, the Gray code for the binary number 1111 is 1100.

(ii) 1010

To convert a binary number to Gray code, you can follow the rules:

1. The leftmost (most significant) bit of the Gray code remains the same as the leftmost bit of the binary number.
2. For each subsequent bit, calculate it as the XOR (exclusive OR) of the corresponding binary bit and the
previous Gray code bit.

Let's convert the binary number 1010 to Gray code:


• Binary: 1 0 1 0
• Gray: 1 (1⊕0) (0⊕1) (1⊕0)
• The leftmost bit remains the same: 1.
• For the second bit, 1 ⊕ 0 = 1.
• For the third bit, 0 ⊕ 1 = 1.
• For the fourth bit, 1 ⊕ 0 = 1.

So, the Gray code for the binary number 1010 is 1101.

(iii) 11100001010

To convert the binary number 11100001010 to Gray code, you can follow these rules:

1. The leftmost (most significant) bit of the Gray code remains the same as the leftmost bit of the binary number.
2. For each subsequent bit, calculate it as the XOR (exclusive OR) of the corresponding binary bit and the
previous Gray code bit.

Let's convert the binary number 11100001010 to Gray code:

Binary: 1 1 1 0 0 0 0 1 0 1 0
Gray: 1 (1⊕1) (1⊕1) (0⊕0) (0⊕0) (0⊕0) (0⊕1) (1⊕0) (0⊕1) (1⊕0) (0⊕1)
Gray Result: 1 0 0 0 0 0 1 1 1 1 1
• The leftmost bit remains the same: 1.
• For the second bit, 1 ⊕ 1 = 0.
• For the third bit, 1 ⊕ 1 = 0.
• For the fourth bit, 0 ⊕ 0 = 0.
• For the fifth bit, 0 ⊕ 0 = 0.
• For the sixth bit, 0 ⊕ 0 = 0.
• For the seventh bit, 0 ⊕ 1 = 1.
• For the eighth bit, 1 ⊕ 0 = 1.
• For the ninth bit, 0 ⊕ 1 = 1.
• For the tenth bit, 1 ⊕ 0 = 1.
• For the eleventh bit, 0 ⊕ 1 = 1.

So, the Gray code for the binary number 11100001010 is 10000011111.

3. (a) Explain fixed point number system and floating point number system with suitable example?
(5)
Fixed and Floating-Point Number: In digital technology, data is stored in memory registers with binary
bits 0’s and 1’s because the computer only understands binary language. When we enter data in the
system, it is converted into binary bits, and it is processed and used in the CPU in different
ways. Memory registers have a format and a specific range to store data. Scientists have designed a real
number representation method in memory registers of 8 bit, 16 bit, 32bit.
There two types of approaches that are developed to store real numbers with the proper method.

• Fixed point number


• Floating point number
Fixed point representation
In computing, fixed-point number representation is a real data type for a number. With the help of fixed
number representation, data is converted into binary form, and then data is processed, stored and used
by the system.
Fixed point representation of data

Sign bit -The fixed-point numbers in binary uses a sign bit. A positive number has a sign bit 0, while a
negative number has a sign bit 1.
Integral Part – The integral part is of different lengths at different places. It depends on the register's
size, like in an 8-bit register, integral part is 4 bits.
Fractional part – Fractional part is also of different lengths at different places. It depends on the
register's size, like in an 8-bit register, integral part is of 3 bits.
8 bits = 1Sign bit + 4 bits(integral) + 3bits (fractional part)
16 bits = 1Sign bit + 9 bits(integral) +6 bits (fractional part)
32 bits = 1Sign bit + 15 bits(integral) + 9 bits (fractional part)
How to write the number in Fixed-point notation?
Number is 4.5
Step 1:- Convert the number into binary form.
4.5 = 100.1
Step 2:- Represent binary number in Fixed point notation

The smallest negative number in fixed-point representation.


1 1 1 1 1 1 1 1
Smallest negative number = -15.875
The largest number in fixed-point representation.
0 1 1 1 1 1 1 1
Larger number = +15.875
Note:- Range of fixed-point notation is from -15.875 to +15.875. We conclude that the fixed-point
notation range is very less as we can only represent the number in a set limit. It is not suitable for
presenting a large amount of data, so it is not used in computer nowadays.
Therefore, scientists feel that the system needs a new representation format with the least or no limit
because data is becoming a vast nowadays. So, floating-point representation came into existence.
Floating-point representation
To discard the limitation of fixed-point notation, floating-point number representation was developed by
scientists. The computer system uses floating-point numbers representation to convert input data into
binary form. The binary form number is converted into ‘scientific notation,' and then this scientific notation
is converted into floating-point representation.
The floating-point notation has two types of notation
1. Scientific notation
2. Normalized notation

Scientific notation – Method of representing binary numbers into a x be form. Scientific notation is
further converted into floating-point notation because floating-point notation only accepts scientific
notation. For example:-
Number = 376.423 ( its not scientific notation)
Number in scientific = 36.4423 x 101 or 3.64423 x 102

For example:- 32.625 x 103


1101.101 * 2101
where 1101.101 is the mantissa part.
2101 = It is the base part where we need not explicitly represent radix or base because the binary base is
always 2.
Note: The major problem in this notation is while storing mantissa, we need to tell the decimal position
every time to the processor. So to overcome this problem, normalized notation was invented and used.
Normalized notation- It is a special case of scientific notation. Normalized means after the decimal
point, we have atleast one non-zero digit.
Normalized notation -

where, value of m= .1?m?1, b= base, e= exponent integer


± 0.1bbbb…..b * 2±e
If mantissa =101, then the processor will interpret it as 0.101 itself, so it's not necessary to tell the
position of the decimal point every time to the processor.
For example- .36 x 1035 is a normalized notation in which the value of m is between .1 to 1. In
normalized notation, value of m remains between .1 ?m?1.
For example:- 1101.101 * 2101 = (5)10 (convert this into normalized form)
0.1101101 * 2(1001)2 =(9)10=(5+4)10
So, there is no need to tell about the decimal point's position every time to the processor.

• Zero (0) cannot be represented or normalized because the representation set starts from 0.1, so
how can we normalize zero. It’s not possible.
• If the most significant bit of mantissa is a non zero, then such a representation is
called normalized floating-point.

So, four things are used to represent a floating-point number: -

1. Sign of Mantissa
2. Sign of Exponent
3. Magnitude of Mantissa
4. Magnitude of Exponent

How to represent a number in floating-point representation?


Floating-point representation of data in a 16-bit register.
Sign bit -The fixed-point numbers in binary uses a sign bit. A positive number has a sign bit 0, while a
negative number has a sign bit 1. In floating-point representation, sign of a number always depends on
mantissa, not on exponent. Hence sign bit in the format is always for mantissa and not for the exponent.
Mantissa Part –Mantissa part is of different length at a different place. It depends on the size of the
register like in 16-bit register; mantissa part is of 8 bits.
Exponent part – Exponent is the power of the number. It depends on the register's size; like in the 16-bit
register, exponent part is 7 bits. Excess 16,64,128, 512 are used to store exponent in this format.

(b) Evaluate the following: (2+2+2)


(i) 10000001-1111=(?)₂

Binary subtraction follows similar rules to decimal subtraction but with just two possible digits (0 and 1). Here
are the basic rules for binary subtraction:

1. 0 - 0 = 0: When subtracting 0 from 0, the result is 0.


2. 1 - 0 = 1: When subtracting 0 from 1, the result is 1.
3. 1 - 1 = 0: When subtracting 1 from 1, the result is 0.
4. 0 - 1 with borrowing: When subtracting 1 from 0, you need to borrow 1 from the next higher significant bit.
This becomes a "borrow" of 1, and the 0 becomes 10. So, 10 - 1 = 1.

(ii)101010×11=(?)₂
(iii) 10100010÷101=(?)₂

You might also like