0% found this document useful (0 votes)
90 views

Combinepdf

This document outlines instructions and questions for a midterm exam on digital logic design. It provides 25 terms related to number systems and conversions between binary, decimal, octal, and hexadecimal numbering systems. Students are instructed to answer the questions in their own words without copying from other sources and prepare for a follow up viva voce exam.

Uploaded by

알리샤얀
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)
90 views

Combinepdf

This document outlines instructions and questions for a midterm exam on digital logic design. It provides 25 terms related to number systems and conversions between binary, decimal, octal, and hexadecimal numbering systems. Students are instructed to answer the questions in their own words without copying from other sources and prepare for a follow up viva voce exam.

Uploaded by

알리샤얀
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/ 23

University of Sargodha

Computer Science and Information Technology


MID TERM EXAM
INSTRUCTOR: Naveed Ahmad
SUBJECT: Digital Logic Design CLASS: BSIT 2nd (Reg/Self)
TIME ALLOWED: 1-week MARKS: 30
Student Name Student Roll No.

Instructions
1. Don’t copy data from internet, you may take concept and then type in your own words.
2. Don’t copy from your class fellow because plagiarism will be checked and you will get NO
CREDIT if data is copied.
3. Viva will be conducted on the completion of the paper, so be prepared conceptually about
what you type here in your paper.
4. Write your answers in the given space of this paper sheet, for question 1 you may add
more rows to add more terms and for question 2 you may extend the box.

Question 1: Watch all video lectures on DLD (three lectures per day, my suggestion) and find out
the terms being used there. Write the terms and their description in your own words,

don’t copy from the internet or from your


class fellow. Viva will be also conducted
for
this question. [MARKS: 10+6 = 16]

Link to DLD Playlist:


https://www.youtube.com/playlist?list=PLuBM8LkREOp_Xj9Y0YZsvaE0UHL1RLaAv

No. Term Description


1 Number system A number system is defined of writing for expressing numbers. And
the path of represent the number is called number system.

2 Decimal number system Represent the number system of base 10-(0,1,2,3,4,5,6,7,8,9) is


known as decimal number system.

3 Binary number system Represent the number system of base 2-(0 or 1) is known as binary
number system.

4 Octal number system Represent the number system of base 8- (0, 1, 2, 3, 4, 5, 6, 7) is


known as octal number system.

5 Hexadecimal number Represent the number system of base 16-


system (0,1,2,3,4,5,6,7,8,9,10,12,13,14,15)

6 Convert decimal to Decimal number = 12


binary

2 12
2 6-0

2 3-0

1-1

Binary number = 1100

7 Convert Decimal to octal Decimal number =12

8 12

1-4

Octal number = 14

8 Convert decimal to Decimal number = 20


hexadecimal

16 20

1-4

Hexadecimal number = 14

9 Convert Binary to Binary number = 1101.0101


decimal
1*2^3 + 1*2^2 +0*2^1 +1*2^0 . 0*2^3 +1*2^2 +0*2^1 +1*2^0

Decimal number = 13.5


10 Convert binary to octal Binary number system =1101.0010

We know that in octal we make 3-3 bit pairs

Then convert binary to octal number system

As we solve here;

0 0 1 1 0 1. 0 0 1 1 0 0

0*2^2 + 0*2^1 + 1*2^0 = 1

1*2^2 + 0*2^1 + 1*2^0 = 5

0*2^ 0 +0*2^1 + 1*2^2= 4

1*2^0 + 0*2^1 + 0*2^2= 1

Octal number =15.41

11 Convert Binary to Binary number =001101.001100


hexadecimal
We know that in hexadecimal we make 4-4 bit pairs

Then convert binary to hexadecimal number system

As we solve here

0*2^3 + 0*2^2 + 0*2^1 + 0*2^0 = 0

1*2^3 + 1*2^2 + 0*2^1 + 1*2^0 = 13

0*2^0 + 0*2^1 + 1*2^2 + 1*2^3 = 12

0*2^0 + 0*2^1 + 0*2^2 + 0*2^3 = 0

Hexadecimal number =13.12

12 Convert octal to decimal Octal number = 40.24

4*8^1 + 0*8^0 . 2*8^-1 + 4*8^-2


Octal number = 32.24

13 Convert octal to binary Octal number = 42.24

2 4

2 2-0

1-0

100

2 2

1-0

10

Binary number is = 10010.10010

14 Convert octal to Octal number = 42.24


hexadecimal
First the step convert octal to decimal and then convert into
hexadecimal.

4*8^1 + 2*8^0 . 2*8^-1 + 2*8^-2

Decimal number = 34.16

16 34

2-2

16*0.16 = 2.56

16*0.56 = 8.96

16*0.96 = 15.36

16*0.36 = 5.76

Hexadecimal number = 22.28F5

15 Convert Hexadecimal to Hexadecimal number = 2F.213


decimal number
2*16^1 + F*16^0 . 2*16^-1 + 1*16^-2 + 3*16^-3

DECIMAL NUMBER = 47.13

16 Convert hexadecimal to Hexadecimal number = 25.24F


binary number

2 2

1-0

10

2 5

2 2-1

1-0

101

2 4

2 2-0

1-0

100

Binary number = 10101.10100

17 Hexadecimal to octal Hexadecimal number = 2F.47


number
First convert hexadecimal to binary and then convert octal number

The binary number is =00101111.00100111

Take 3-3 pair in octal number

I shorted to this question and show the answer

Octal number = 57.116

18 complements Complements are used in the digital computers in order to simplify


the subtraction operation and for the logical manipulations.

19 Binary complements The binary complements is a number is create a revers of all bits as
in the bracket (0 to 1 and 1 to 0) and then add 1 to given binary
number.

20 1’s complements One’s complements mean that convert 1 into zero and 0 into 1 is
called 1’s complements.

Example : 10001 1;s complement is 01110

21 2’s complements 2’s complements mean that the first of all we take a binary number
and then take 1’s complements and then 1 add in the answer of 1’s
complements is called 2’s complements

Example : binary number = 10011

1’s complement is = 01100

+ 1

2’s complements 01101

22 9’s complements 9’s complements means that 9 subtracted the given all decimal
numbers. Each digit are subtracted in the 9

Example : decimal number = 2345

We take 9’s complement

9999

- 2345

9’s complement is 7654

23 10’s complements 10's complement of a decimal number can be found by adding 1 to


the 9's complement of that decimal number. It is just like 2s
compliment in binary number representation. For example, let us
take a decimal number 456, 9's complement of this number will be
999-456 which will be 543. Now 10s compliment will be

999 456

- 543 + 1

456 457

24 7,s complement 7's complement of a number is obtained by subtracting all bits from
777. 7's complement of a number is obtained by subtracting all bits
from 777. Solution: 7's complement of a number is obtained by
subtracting all bits from 777.

Example: 777

_ 234

543

25 8,S Complement 8's complement of a number is 1 added to it's


7's complement number solution 8's complement of a number is 1
added to it's 7's complement number

Given binary number is 345

888

- 345

543

Then 8’s complement


543

+1

544

26 15’complements 15's complement of a number is obtained by subtracting all bits


from FFF. 15's complement of a number is obtained by subtracting
all bits from FFF. Now here I written my example.given number is
8765

Example:

FFFF

- 8765

789A ans of 15’s complement

27 16’complement 16's complement of a number is 1 added to it's


15's complement number solution16's complement of a number is 1
added to it's 15's complement number

First we take 15’ complement

FFFF

- 2345

DCBA then we take 16’s complement

DCBA

+ 1

DCBB this is ans

28 Parity bit A bit which acts as a check of a set of binary values, calculated in
such a way that the number of 1s in the set plus the parity bit should
always be even or odd.

29 Even parity Even parity refers of a parity checking mode in asynchronous


communication systems in which an extra bit, called a parity bit, is
the set to zero if there is an even number of one bits in a one-byte
data item. If the number of one bits adds up to an odd number, the
parity bit is set to one.

Even parity checking may also be used in testing memory storage


devices

30 Odd parity In asynchronous communication systems, odd parity bring up to


parity checking modes, where all set of transmitted bits has an odd
number of bits. If the total number of ones in the data plus the
parity bit is an odd number of ones, it is called odd parity. If the data
already has an odd number of ones, the value of the added parity bit
is 0, otherwise it is 1.

31 Logic operation Logic operations create any operations that manipulate Boolean
values. Boolean values are either true or false. They are named after
English mathematician George Boole, who formulated Boolean
algebra, and is widely considered the founder of computer science
theory. They can also be represented as 1 and 0 form.

32 AND operation Logical AND operation is .The AND logic operation returns true
only if The AND logic operation returns true only if either of its
inputs are true. If either of the inputs is false, the output is also
false. In computer programming, the AND operation is usually
written as &&

33 OR operation The OR operator is a Boolean operator which would return the


value TRUE or Boolean value of 1 if either or both of the operands
are TRUE or have Boolean value of 1. The OR operator is considered
one of the basic logical operators along with AND and NOT in
Boolean algebra. It is widely used in programming languages which
support logical and comparison operators.

34 NOT operation In Boolean algebra, the NOT operator is a Boolean operator that
returns TRUE or 1 when the operand is FALSE or 0, and returns
FALSE or 0 when the operand is TRUE or 1. ... The NOT operator is
considered one of the basic operators along with AND and OR in
Boolean algebra. The NOT operator is also known as the logical NOT.

35 NAND operation NAND operation is a connective in logic equivalent to the


composition NOT AND that yields true if any condition is false, and
false if all conditions are true. NAND is equivalent to ,
where denotes NOT and denotes AND

36 NOR Operation The NOR operation is a logical operation on two logical values,
typically the values of two propositions, that produces a value of
true if and only if both operands are false. In other words, it
generate a value of false if and only if at least one operand is true.

37 X-NOR operation An XNOR gate (sometimes referred to by its extended


name, Exclusive NOR gate) is a digital logic gate with two or more
inputs and one output that performs logical equality. The output of
an XNOR gate is true when all of its inputs are true or when all of its
inputs are false.

38 X-OR operation XOR is a binary operation, it stands for "exclusive or", that is to
say the resulting bit evaluates to one if only exactly one of the bits is
set. This operation is performed between every two corresponding
bits of a number.

39 Boolean function A Boolean function is a function in mathematics and logic whose


arguments, as well as the function itself, assume values from a two-
element set (usually {0,1}). ... A Boolean function takes the form ƒ :
Bk → B, where B = {0, 1} is a Boolean domain and k is a non-negative
integer called the parity of the function.
40 Truth table A truth table shows how the truth or falsity of a
compound statement depends on the truth or falsity of the
simple statements from which it's constructed. ... To
understand why this table is the way it is, consider the
following example: "If you get an A, then I'll give you a
dollar."
41 Min-term (sum of Min - terms is the form of expression in which different product
product) terms are summed (+) each other is called sum of product

42 Max-terms (Product of Max-terms is the form of expression in which sum terms are
sum) products(*) together is called product of sum.

43 Karnaugh Map(K map) A Karnaugh map provides a pictorial method of grouping


together expressions with common factors and therefore
eliminating unwanted variables. The Karnaugh map can also be
described as a special arrangement of a truth table

Question 2: Write a program in C++ programming language that provides us with Number System
Conversion. [MARKS: 10+4 = 14]

Input: This program should get Source Number, Input Base and Target Base.

Output: This program should give Target Number.

Enter the source number: 9


Enter the source base: 10
Enter the target base: 2

Target Number: 1001

The interface of the program must be as following

Answer:

You might also like