We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

# CS101 Assignment No 1 Solution & Discussion Due Date:12-11-2012

Instructions:

• You will submit your assignment before or on due date (12 Nov 2012) on VU-LMS.
• Assignment should be completed by your own efforts it should not be copied from internet, handouts or books.
• You should submit your MS Word File via assignment interface at VU-LMS.
• Assignment sent via Email will not be replied and accepted/graded in any case.
• If the submitted assignment does not open or file is corrupt, it will not be graded.
• You will submit solution only in Microsoft Word File.

Question No 1:                                                                                                                      Marks 5

Distinguish the following as: input, output, processing, communication and storage devices:

• Microphone
• CPU
• Digital pen
• Modem
• CD/DVD disc
• Speakers
• Multimedia Projector
• USB flash drive

Question No 2:

Marks 10

Convert the following:

a)      (410)10 decimal number into its equivalent binary number (5 Marks)

b)      (101101)2 binary number into its equivalent decimal number. (5 Marks)

Note: Show all the steps needed for the conversions, otherwise marks will be deducted.

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

Views: 5374

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

Replies are closed for this discussion.

### Replies to This Discussion

Binary number(value):1 0 0 1 0 0 0 1
Index :7 6 5 4 3 2 1 0

you only have to make one loop which will do like this = (pow(2,0)*(value at this index) + pow(2,1)*(value at this index) + pow(2,2)*(value at this index) + pow(2,3)*(value at this index) + ....) where 0,1,2,3 are index

anther

### How to Convert Binary to Decimal

In order to help you to understand how to convert binary to decimal, it may help to look at how we translate the value of a decimal number. Lets use the decimal number 1234 (123410, or one-thousand, two-hundred and thirty-four) as an example:

Translating the Value of a Decimal (base 10) Number

 A Power of 10: 103 102 101 100 B Place value (A result): 1000 100 10 1 C Entered decimal digit: 1 2 3 4 D Product of B * C: 1000 200 30 4 E Cumulative total of D: 1000 1200 1230 1234

With the above base 10 translation in mind, here is how you would convert the base 2 number 1111 (11112 or one-one-one-one) into a base 10 number:

Converting a Binary (base 2) to a Decimal (base 10)

 A Power of 2: 23 22 21 20 B Place value (A result): 8 4 2 1 C Entered binary digit: 1 1 1 1 D Product of B * C: 8 4 2 1 E Cumulative total of D: 8 12 14 15

Adding the values of line D we get the base 10 number of 15. In other words, the number 11112 coverts to the number 1510.

As you can see, converting a binary number to a decimal number is a simple process of identifying the place value of each digit, multiplying each digit by its place value, and then adding up all of the products.

### Converting Base 2 Numbers That Have Decimal Points

If the base 2 you want to convert has a decimal point in it, you simply continue subtracting 1 from each exponent (line A below) as you move from left to right. For example, here is how you would convert 111.1012 into its base 10 equivalent:

Converting a Binary That Has a Decimal Point

 A Power of 2: 22 21 20 2-1 2-2 2-3 B Place value (A result): 4 2 1 0.5 0.25 0.125 C Entered binary digit: 1 1 1 1 0 1 D Product of B * C: 4 2 1 0.5 0 0.125 E Cumulative total of D: 4 6 7 7.5 7.5 7.625

Adding the values of line D we get the decimal number 7.625. In other words, the number 111.1012 coverts to the number 7.62510. Note that the red exponents in line A indicate digits that are located to the right of the decimal point.

So you see, in a binary number each place value to the right of the decimal point decreases by 1/2 (--> 1/2, 1/4, 1/8, etc.) as opposed to the place values to the left of the decimal point whose values double with each place you move to the left (8, 4, 2, 1 <--).

With that, let's use the Binary to Decimal Converter to convert base 2 to base 10.

Attachments:

CS101_Assig#01_Solution

Attachments:

 Input Devices Output Devices Input Output (I/O) Processing  Devices Communication Devices Storage Devices Microphone Speakers Modem CPU Modem CD/DVD disc Digital Pen Multimedia Projector USB flash drive Network Adapter USB flash drive Touch pad Network Adapter

Q :2 (a) Convert (410)10 decimal number in to its Binary number :-

Soloution :-

Decimal to Binary Conversion

2                       410           ( remainder)

2                        205              0

2                        102              1

2                         51               0

2                         25               1

2                         12               1

2                         6                 0

2                         3                 0

2                         1                 1

0                              1

We keep dividing 410 by 2  till the last value becomes 0. After that we shall neglect the 1st two columns & start counting from 3rd column from bottom to top. The answer is (110011010)2

(b)  (101101)  Binary to Decimal Conversion :-

(101101)2 =   1 ×  + 0 ×  + 1 ×  + 1 ×  + 0 ×  + 1 ×

=   1 × 1   +   0 × 1    +  1 × 41  × 8   + 0 × 16 + 1 × 32

=   0         +   0           +   4      +     8       +    0      +   32

=  45

1 x 1 = 1

You are writing  1 x 1 = 0 even than you showed the answer 45

it must be syntax error.. Right.

good observation

One more

CS101_Assignment#01_Solution

Attachments:

In computing, input/output or I/O is the communication between an information processing system (such as a computer) and the outside world, possibly a human or another information processing system. Inputs are the signals or data received by the system, and outputs are the signals or data sent from it. The term can also be used as part of an action; to "perform I/O" is to perform an input or output operation. I/O devices are used by a person (or other system) to communicate with a computer. For instance, a keyboard or a mouse may be an input device for a computer, while monitors and printers are considered output devices for a computer. Devices for communication between computers, such as modems and network cards, typically serve for both input and output.

In computing, input/output or I/O is the communication between an information processing system (such as a computer) and the outside world, possibly a human or another information processing system. Inputs are the signals or data received by the system, and outputs are the signals or data sent from it. The term can also be used as part of an action; to "perform I/O" is to perform an input or output operation. I/O devices are used by a person (or other system) to communicate with a computer. For instance, a keyboard or a mouse may be an input device for a computer, while monitors and printers are considered output devices for a computer. Devices for communication between computers, such as modems and network cards, typically serve for both input and output.

Complete CS101 Assignment No 1 Solution Fall 2012

Attachments:

## Latest Activity

+ Տehɑr Ƙհɑղ + replied to Isha Chuhdary's discussion Trust
30 seconds ago
+ Տehɑr Ƙհɑղ + liked Isha Chuhdary's discussion Mera sher
1 minute ago
Tom and jerrry posted a status
"ﺳﺎﺩﮦ ﻣﺰﺍﺝ ﮨﻮﮞ، ﻣﺠﮭﮯ ﺳﺎﺩﮔﯽ ﭘﺴﻨﺪ هے.. ﺗﺨﻠﯿﻖ ﺧﺪﺍ ﮨﻮﮞ، ﻣﺠﮭﮯ ﻋﺎﺟﺰﯼ ﭘﺴﻨﺪ هے..!"
45 minutes ago
Angel joined + M.Tariq Malik's group

### ECO303 Principles of Macroeconomics

55 minutes ago
1 hour ago
1 hour ago
+++A++R+++ replied to 彡Ｆａｒｉａ彡 ❤️'s discussion آجکل کی استانیاں
1 hour ago
+++A++R+++ liked +++A++R+++'s discussion خلوصِ نیت
1 hour ago
1 hour ago
1 hour ago
+++A++R+++ liked +++A++R+++'s discussion Our Education system
1 hour ago
Isha Chuhdary posted discussions
1 hour ago

1

2

3