Page 1
Edurev123
6. Computer Programming
6.1 Find the values of two valued Boolean variables ?? ,?? ,?? ,?? by resolving the
following simultaneous equations :
???
+???? ?=?? ???? ?=????
???? +?? ???
+???? ?=???
??
where ??? denotes the complement of ?? .
(2009 : 6 Marks)
Solution:
???
+???? =0
? (???
+?? )(?? +?? ) =0
? 1·(???
+?? ) =???
+?? =0
It means ???
+?? =0
? ???
=0 and ?? =0
?? =1 and ?? =0
??1·(???
+?? )=???
+?? =0?[??? +???=1&1·?? =?? ]
Put this values in second equation, i.e.
???? ?=????
1.?? ?=1.?? ?? ?=?? =0
Put values of ?? ,?? &?? in third equation, i.e.,
???? +?? ???
+???? ?=???
?? 1.0+1.0
¯
+0.?? ?=0
¯
?? 0+1+0?=1.?? =?? ?? ?=1
6.2 (i) Realize the following expression by using NAND gates oniy : ?? =(???+???
+
?? )???
(???+?? )?? where ??? denotes the complement of ?? .
(2009 : 6 Marks)
(ii) Find the decimal equivalent of (357.32) .
(2009 : 6 Marks)
Solution:
Page 2
Edurev123
6. Computer Programming
6.1 Find the values of two valued Boolean variables ?? ,?? ,?? ,?? by resolving the
following simultaneous equations :
???
+???? ?=?? ???? ?=????
???? +?? ???
+???? ?=???
??
where ??? denotes the complement of ?? .
(2009 : 6 Marks)
Solution:
???
+???? =0
? (???
+?? )(?? +?? ) =0
? 1·(???
+?? ) =???
+?? =0
It means ???
+?? =0
? ???
=0 and ?? =0
?? =1 and ?? =0
??1·(???
+?? )=???
+?? =0?[??? +???=1&1·?? =?? ]
Put this values in second equation, i.e.
???? ?=????
1.?? ?=1.?? ?? ?=?? =0
Put values of ?? ,?? &?? in third equation, i.e.,
???? +?? ???
+???? ?=???
?? 1.0+1.0
¯
+0.?? ?=0
¯
?? 0+1+0?=1.?? =?? ?? ?=1
6.2 (i) Realize the following expression by using NAND gates oniy : ?? =(???+???
+
?? )???
(???+?? )?? where ??? denotes the complement of ?? .
(2009 : 6 Marks)
(ii) Find the decimal equivalent of (357.32) .
(2009 : 6 Marks)
Solution:
(i) So
?? (?? ,?? ,?? ,?? )=(???+???
+?? )???
(???+?? )?? =?? ·?? ·???
¯¯¯¯¯¯¯¯¯¯
???
?? ·???
¯¯¯¯¯¯
?? =???????? =????????¯¯¯¯¯¯¯¯
Now the expression by NAND gates will be
This is the required circuit.
(ii) (357.32) )
8
to decimal conversion
(357.32)
8
?=3×8
2
+5×8
1
+7×8
0
+3×8
-1
+2×8
-2
?=(192+40+7+0.375+0.03125)
10
?=(239.40625)
10
6.3 If ?? ??? =?? ?? '
+?? '
?? . Find the value of ?? ??? ??? .
(2010 : 6 Marks)
Solution:
Given :
?? ??? ?=?? ?? '
+?? '
?? ?? ??? ??? ?=(?? ?? '
+?? '
?? )??? ?=?????? +?? '
???? +(?? ?? )
'
·(?? '
?? )
'
?? ?=?????? +?? '
???? +(?? '
+(?? )
'
)·((?? '
)
'
+?? )?? ?=?????? +?? '
???? +(?? '
+?? )·(?? +?? )?? ?=?????? +?? '
???? +(?? '
?? +?? '
?? +???? +?? ·?? )?? ?=?????? +?? '
???? +(0+?? '
?? +???? +0)?? ?=???? ?? '
+?? '
???? +?? '
?? ?? +?????? ?=?????? +?????? +?? '
???? +?? '
?? ?? '
6.4 (a) Find the hexadecimal equivalent of the decimal number (???????????? )
????
(2010 : 5 Marks)
(b) For the given set of data points
(?? ?? ,?? (?? ?? )),(?? ?? ,?? (?? ?? )),…(?? ?? ,?? (?? ?? ))
Page 3
Edurev123
6. Computer Programming
6.1 Find the values of two valued Boolean variables ?? ,?? ,?? ,?? by resolving the
following simultaneous equations :
???
+???? ?=?? ???? ?=????
???? +?? ???
+???? ?=???
??
where ??? denotes the complement of ?? .
(2009 : 6 Marks)
Solution:
???
+???? =0
? (???
+?? )(?? +?? ) =0
? 1·(???
+?? ) =???
+?? =0
It means ???
+?? =0
? ???
=0 and ?? =0
?? =1 and ?? =0
??1·(???
+?? )=???
+?? =0?[??? +???=1&1·?? =?? ]
Put this values in second equation, i.e.
???? ?=????
1.?? ?=1.?? ?? ?=?? =0
Put values of ?? ,?? &?? in third equation, i.e.,
???? +?? ???
+???? ?=???
?? 1.0+1.0
¯
+0.?? ?=0
¯
?? 0+1+0?=1.?? =?? ?? ?=1
6.2 (i) Realize the following expression by using NAND gates oniy : ?? =(???+???
+
?? )???
(???+?? )?? where ??? denotes the complement of ?? .
(2009 : 6 Marks)
(ii) Find the decimal equivalent of (357.32) .
(2009 : 6 Marks)
Solution:
(i) So
?? (?? ,?? ,?? ,?? )=(???+???
+?? )???
(???+?? )?? =?? ·?? ·???
¯¯¯¯¯¯¯¯¯¯
???
?? ·???
¯¯¯¯¯¯
?? =???????? =????????¯¯¯¯¯¯¯¯
Now the expression by NAND gates will be
This is the required circuit.
(ii) (357.32) )
8
to decimal conversion
(357.32)
8
?=3×8
2
+5×8
1
+7×8
0
+3×8
-1
+2×8
-2
?=(192+40+7+0.375+0.03125)
10
?=(239.40625)
10
6.3 If ?? ??? =?? ?? '
+?? '
?? . Find the value of ?? ??? ??? .
(2010 : 6 Marks)
Solution:
Given :
?? ??? ?=?? ?? '
+?? '
?? ?? ??? ??? ?=(?? ?? '
+?? '
?? )??? ?=?????? +?? '
???? +(?? ?? )
'
·(?? '
?? )
'
?? ?=?????? +?? '
???? +(?? '
+(?? )
'
)·((?? '
)
'
+?? )?? ?=?????? +?? '
???? +(?? '
+?? )·(?? +?? )?? ?=?????? +?? '
???? +(?? '
?? +?? '
?? +???? +?? ·?? )?? ?=?????? +?? '
???? +(0+?? '
?? +???? +0)?? ?=???? ?? '
+?? '
???? +?? '
?? ?? +?????? ?=?????? +?????? +?? '
???? +?? '
?? ?? '
6.4 (a) Find the hexadecimal equivalent of the decimal number (???????????? )
????
(2010 : 5 Marks)
(b) For the given set of data points
(?? ?? ,?? (?? ?? )),(?? ?? ,?? (?? ?? )),…(?? ?? ,?? (?? ?? ))
Write an algorithm to find the value of ?? (?? ) by using Lagrange's interpolation
formula.
(2010 : 10 Marks)
(c) Using Boolean algebra, simplify the following expressions:
(i) ?? +?? '
?? +?? '
?? '
?? +?? '
?? '
?? '
?? +?
(ii) ?? '
???? +???? +???? where ?? '
represents the complement of ?? .
(2010 : 5 Marks)
Solution:
(a) Given number is (587632)
10
.
??(587632)
10
=(8?? 770)
16
(b) The algorithm is written below:
1. Read ?? 1
??
2. For ?? =1 to (?? +1) in steps of 1 do read ?? ?? ,?? (?? ?? ) end for
3. For ?? =1(?? +1) in steps of 1 do
4. Prod func ?1
5. For ?? =1 to (?? +1) in steps of 1 do
6. If (?? ???) then
16 587632 0
16 36727 7
16 2295 7
16 143 F
16 8 8
0
prod func ? prod func ×
(?? -?? ?? )
(?? ?? -?? ?? )
end for
Page 4
Edurev123
6. Computer Programming
6.1 Find the values of two valued Boolean variables ?? ,?? ,?? ,?? by resolving the
following simultaneous equations :
???
+???? ?=?? ???? ?=????
???? +?? ???
+???? ?=???
??
where ??? denotes the complement of ?? .
(2009 : 6 Marks)
Solution:
???
+???? =0
? (???
+?? )(?? +?? ) =0
? 1·(???
+?? ) =???
+?? =0
It means ???
+?? =0
? ???
=0 and ?? =0
?? =1 and ?? =0
??1·(???
+?? )=???
+?? =0?[??? +???=1&1·?? =?? ]
Put this values in second equation, i.e.
???? ?=????
1.?? ?=1.?? ?? ?=?? =0
Put values of ?? ,?? &?? in third equation, i.e.,
???? +?? ???
+???? ?=???
?? 1.0+1.0
¯
+0.?? ?=0
¯
?? 0+1+0?=1.?? =?? ?? ?=1
6.2 (i) Realize the following expression by using NAND gates oniy : ?? =(???+???
+
?? )???
(???+?? )?? where ??? denotes the complement of ?? .
(2009 : 6 Marks)
(ii) Find the decimal equivalent of (357.32) .
(2009 : 6 Marks)
Solution:
(i) So
?? (?? ,?? ,?? ,?? )=(???+???
+?? )???
(???+?? )?? =?? ·?? ·???
¯¯¯¯¯¯¯¯¯¯
???
?? ·???
¯¯¯¯¯¯
?? =???????? =????????¯¯¯¯¯¯¯¯
Now the expression by NAND gates will be
This is the required circuit.
(ii) (357.32) )
8
to decimal conversion
(357.32)
8
?=3×8
2
+5×8
1
+7×8
0
+3×8
-1
+2×8
-2
?=(192+40+7+0.375+0.03125)
10
?=(239.40625)
10
6.3 If ?? ??? =?? ?? '
+?? '
?? . Find the value of ?? ??? ??? .
(2010 : 6 Marks)
Solution:
Given :
?? ??? ?=?? ?? '
+?? '
?? ?? ??? ??? ?=(?? ?? '
+?? '
?? )??? ?=?????? +?? '
???? +(?? ?? )
'
·(?? '
?? )
'
?? ?=?????? +?? '
???? +(?? '
+(?? )
'
)·((?? '
)
'
+?? )?? ?=?????? +?? '
???? +(?? '
+?? )·(?? +?? )?? ?=?????? +?? '
???? +(?? '
?? +?? '
?? +???? +?? ·?? )?? ?=?????? +?? '
???? +(0+?? '
?? +???? +0)?? ?=???? ?? '
+?? '
???? +?? '
?? ?? +?????? ?=?????? +?????? +?? '
???? +?? '
?? ?? '
6.4 (a) Find the hexadecimal equivalent of the decimal number (???????????? )
????
(2010 : 5 Marks)
(b) For the given set of data points
(?? ?? ,?? (?? ?? )),(?? ?? ,?? (?? ?? )),…(?? ?? ,?? (?? ?? ))
Write an algorithm to find the value of ?? (?? ) by using Lagrange's interpolation
formula.
(2010 : 10 Marks)
(c) Using Boolean algebra, simplify the following expressions:
(i) ?? +?? '
?? +?? '
?? '
?? +?? '
?? '
?? '
?? +?
(ii) ?? '
???? +???? +???? where ?? '
represents the complement of ?? .
(2010 : 5 Marks)
Solution:
(a) Given number is (587632)
10
.
??(587632)
10
=(8?? 770)
16
(b) The algorithm is written below:
1. Read ?? 1
??
2. For ?? =1 to (?? +1) in steps of 1 do read ?? ?? ,?? (?? ?? ) end for
3. For ?? =1(?? +1) in steps of 1 do
4. Prod func ?1
5. For ?? =1 to (?? +1) in steps of 1 do
6. If (?? ???) then
16 587632 0
16 36727 7
16 2295 7
16 143 F
16 8 8
0
prod func ? prod func ×
(?? -?? ?? )
(?? ?? -?? ?? )
end for
8. Sum ? sum +?? (?? ?? )× Prod func end for
9. Write ?? ,sm
10. Stop
(c) (i) ?? +?? '
?? +?? '
?? '
?? +?? '
?? '
?? '
?? +..
Now, ??? +?? '
?? =?? (1+?? )+?? '
?? =?? +???? +?? '
??
=?? +y(?? +?? '
)=?? +?? ·1
???? +?? '
?? =?? +??
Similarly, ??? +?? '
?? +?? '
?? '
?? =?? +?? +??
??? +?? '
?? +?? '
?? '
?? +?? '
?? '
?? '
?? +?=?? +?? +?? +?? +?
(ii) ?? '
?? '
?? +???? +????
?=?? (?? '
?? '
+?? )+????
?=?? (?? '
?? '
+?? (?? +?? '
))+????
?=?? (?? '
?? '
+???? +?? '
?? )+????
?=?????? +?? (?? '
?? '
+?? '
?? )+????
?=?????? +?? '
?? +????
?=???? ?? +?? (?? +?? '
)=?????? +?? ?=?? (1+???? )=??
6.5 (a) Compute (3205) )
????
to the base 8.
(b) Let ?? be an arbitrary but fixed Boolean algebra with operations ?,?? and' and
the zero and the unit element denoted by 0 and 1 respectively. Let ?? ,?? ,?? ,……. be
elements of ?? .
If ?? ,?? ??? be such that ?? ??? =?? and ?? ??? =? then prove that ?? =?? '
.
(2011 : 12 Marks)
Solution:
(3205)
10
to be base 8 .
??(3205)
10
=(6205)
8
Page 5
Edurev123
6. Computer Programming
6.1 Find the values of two valued Boolean variables ?? ,?? ,?? ,?? by resolving the
following simultaneous equations :
???
+???? ?=?? ???? ?=????
???? +?? ???
+???? ?=???
??
where ??? denotes the complement of ?? .
(2009 : 6 Marks)
Solution:
???
+???? =0
? (???
+?? )(?? +?? ) =0
? 1·(???
+?? ) =???
+?? =0
It means ???
+?? =0
? ???
=0 and ?? =0
?? =1 and ?? =0
??1·(???
+?? )=???
+?? =0?[??? +???=1&1·?? =?? ]
Put this values in second equation, i.e.
???? ?=????
1.?? ?=1.?? ?? ?=?? =0
Put values of ?? ,?? &?? in third equation, i.e.,
???? +?? ???
+???? ?=???
?? 1.0+1.0
¯
+0.?? ?=0
¯
?? 0+1+0?=1.?? =?? ?? ?=1
6.2 (i) Realize the following expression by using NAND gates oniy : ?? =(???+???
+
?? )???
(???+?? )?? where ??? denotes the complement of ?? .
(2009 : 6 Marks)
(ii) Find the decimal equivalent of (357.32) .
(2009 : 6 Marks)
Solution:
(i) So
?? (?? ,?? ,?? ,?? )=(???+???
+?? )???
(???+?? )?? =?? ·?? ·???
¯¯¯¯¯¯¯¯¯¯
???
?? ·???
¯¯¯¯¯¯
?? =???????? =????????¯¯¯¯¯¯¯¯
Now the expression by NAND gates will be
This is the required circuit.
(ii) (357.32) )
8
to decimal conversion
(357.32)
8
?=3×8
2
+5×8
1
+7×8
0
+3×8
-1
+2×8
-2
?=(192+40+7+0.375+0.03125)
10
?=(239.40625)
10
6.3 If ?? ??? =?? ?? '
+?? '
?? . Find the value of ?? ??? ??? .
(2010 : 6 Marks)
Solution:
Given :
?? ??? ?=?? ?? '
+?? '
?? ?? ??? ??? ?=(?? ?? '
+?? '
?? )??? ?=?????? +?? '
???? +(?? ?? )
'
·(?? '
?? )
'
?? ?=?????? +?? '
???? +(?? '
+(?? )
'
)·((?? '
)
'
+?? )?? ?=?????? +?? '
???? +(?? '
+?? )·(?? +?? )?? ?=?????? +?? '
???? +(?? '
?? +?? '
?? +???? +?? ·?? )?? ?=?????? +?? '
???? +(0+?? '
?? +???? +0)?? ?=???? ?? '
+?? '
???? +?? '
?? ?? +?????? ?=?????? +?????? +?? '
???? +?? '
?? ?? '
6.4 (a) Find the hexadecimal equivalent of the decimal number (???????????? )
????
(2010 : 5 Marks)
(b) For the given set of data points
(?? ?? ,?? (?? ?? )),(?? ?? ,?? (?? ?? )),…(?? ?? ,?? (?? ?? ))
Write an algorithm to find the value of ?? (?? ) by using Lagrange's interpolation
formula.
(2010 : 10 Marks)
(c) Using Boolean algebra, simplify the following expressions:
(i) ?? +?? '
?? +?? '
?? '
?? +?? '
?? '
?? '
?? +?
(ii) ?? '
???? +???? +???? where ?? '
represents the complement of ?? .
(2010 : 5 Marks)
Solution:
(a) Given number is (587632)
10
.
??(587632)
10
=(8?? 770)
16
(b) The algorithm is written below:
1. Read ?? 1
??
2. For ?? =1 to (?? +1) in steps of 1 do read ?? ?? ,?? (?? ?? ) end for
3. For ?? =1(?? +1) in steps of 1 do
4. Prod func ?1
5. For ?? =1 to (?? +1) in steps of 1 do
6. If (?? ???) then
16 587632 0
16 36727 7
16 2295 7
16 143 F
16 8 8
0
prod func ? prod func ×
(?? -?? ?? )
(?? ?? -?? ?? )
end for
8. Sum ? sum +?? (?? ?? )× Prod func end for
9. Write ?? ,sm
10. Stop
(c) (i) ?? +?? '
?? +?? '
?? '
?? +?? '
?? '
?? '
?? +..
Now, ??? +?? '
?? =?? (1+?? )+?? '
?? =?? +???? +?? '
??
=?? +y(?? +?? '
)=?? +?? ·1
???? +?? '
?? =?? +??
Similarly, ??? +?? '
?? +?? '
?? '
?? =?? +?? +??
??? +?? '
?? +?? '
?? '
?? +?? '
?? '
?? '
?? +?=?? +?? +?? +?? +?
(ii) ?? '
?? '
?? +???? +????
?=?? (?? '
?? '
+?? )+????
?=?? (?? '
?? '
+?? (?? +?? '
))+????
?=?? (?? '
?? '
+???? +?? '
?? )+????
?=?????? +?? (?? '
?? '
+?? '
?? )+????
?=?????? +?? '
?? +????
?=???? ?? +?? (?? +?? '
)=?????? +?? ?=?? (1+???? )=??
6.5 (a) Compute (3205) )
????
to the base 8.
(b) Let ?? be an arbitrary but fixed Boolean algebra with operations ?,?? and' and
the zero and the unit element denoted by 0 and 1 respectively. Let ?? ,?? ,?? ,……. be
elements of ?? .
If ?? ,?? ??? be such that ?? ??? =?? and ?? ??? =? then prove that ?? =?? '
.
(2011 : 12 Marks)
Solution:
(3205)
10
to be base 8 .
??(3205)
10
=(6205)
8
6.6 Find the logic circuit that represents the following Boolean function. Find also
an equivalent simpler circuit :
(2011: 20 marks)
Solution:
The given Boolean function is
?? (?? ,?? ,?? )=?? ·?? ·?? +???·?? ·??
The logic circuit is :
6.7 Draw a flow chart for Lagrange's interpolation formula.
(2011 : 20 Marks)
Solution:
Flow chart for Lagrange's interpolation formula :
Read More