bg-banner
shape

Important 10-Mark Questions for B.Sc. Computer Science Students

Bachelor of Science in Computer Science (B.Sc. in C.S.)

Fundamental Concepts and Problem Solving

Bachelor of Science in Computer Science (B.Sc. in C.S.) students are expected to solve number of problem solving situations through knowledge on digital systems and computer programming. The program also provides the students with the technical skills and logical reasoning capability required to handle real-life and computational issues. These are some of the key questions which ought to be revised very well before embarking on this academic journey since they would offer the background knowledge that would be needed when one embarks on higher studies in computer science.

1 Expand ASCII.

ASCII is known as American Standard Code of Information Interchange. It is a standard character encoding scheme that is used to code characters which includes alphabets, digits and special symbols in computers. The characters have got their own numeric code assigned to them, which assists in the storage and communication of data between various computer systems.

2 Define tokens.

The smallest significant entity of a C program that the compiler recognizes when compiling it is referred to as tokens. They are the fundamental units of a program. The various C types of tokens are:

  • Keywords
  • Identifiers
  • Constants
  • Operators
  • Special symbols

Tokens help the compiler to understand the structure and meaning of a program.

3 List the special operators used in C.

Special operators in C are operators that perform specific tasks other than arithmetic and logical operations. They include:

  • sizeof – used to find the size of a data type or variable.
  • , (comma) – used to separate multiple expressions.
  • & – address-of operator, obtaining the memory address of a variable.
  • * – pointer operator, used to declare and access pointers.
  • . (dot) – used to access structure members.
  • -> (arrow) – used to access structure members through pointers.
  • [] – array subscript operator, used to access array elements.
  • () – function call operator, used to call a function.

4 What is the use of continue statement?

Continue statement is a loop control statement applied in for, while and do-while loops. The control can jump over all the remaining statements of the current loop iteration with the execution of the continue statement and passes directly to the next loop iteration. It is primarily applied to instances where a specific condition meets and the programmer wishes to forego the remainder of the loop body during that instance without necessarily ending the loop.

5 What are strings?

In C, string is character array of characters, terminated by a null character of character-code (‘\0’). A text, which can be the name, words, and sentences, is stored in strings. An example is that Computer is the name that takes 9 bytes in the memory (8 letters and 1 null character). String manipulations like strlen, strcpy and strcmp etc. are utilized to operate with strings.

6 With a neat diagram, explain the block diagram of a digital computer.

Block Diagram of a Digital Computer

Explanation:

  • Input Unit: It is provided with data and instructions by the user via such devices as keyboard, mouse, or scanner. It transforms them to machine-readable format (binary).
  • Memory Unit: It holds information, commands, temporary output and end product. It consists of RAM and ROM. ROM is non-volatile in other place ROM is volatile.
  • Central Processing Unit (CPU): The computer brain is it and consists of two parts:
    • ALU (Arithmetic Logic Unit): It is the unit that performs arithmetic and logical operations (addition, subtraction, and comparisons, and AND, OR, etc.).
    • Control Unit (CU): Controls and coordinates all the activities of the parts of the computer by issuing control signals.
  • Output Unit: It transforms processed data into the readable form of human personnel through devices such as monitor and printer.

7 Explain basic gates with its circuit and truth table.

Basic gates are AND, OR, and NOT gates.

(a) AND Gate

andgate

Boolean Expression: Y = A · B

Truth Table:

A B Y
0 0 0
0 1 0
1 0 0
1 1 1

Explanation: The output is high when both inputs are high.

(b) OR Gate

orgate

Boolean Expression: Y = A + B

Truth Table:

A B Y
0 0 0
0 1 1
1 0 1
1 1 1

Explanation: The output is High when any one of the input is High.

(c) NOT Gate

notgate

Boolean Expression: Y = A̅

Truth Table:

A Y
0 1
1 0

Explanation: It inverts the input signal.

8 Design and explain full subtractor.

The entire subtractor is required since the half-subtractor could only subtract the least significant bit (LSB) of the binary numbers. Nonetheless, when a borrow is created in the subtraction of the LSBs, it will influence the subtraction in subsequent stages.

This case is dealt with by a full subtractor which uses the borrow of the previous stage so that the subtraction is correct even in the case of a borrow which is available. The full subtractor is appropriate in multi-bit subtraction in digital circuit boards such as Arithmetic Logic Unit (ALU) because it can accurately subtract binary numbers with support of borrowing.

Inputs: A (minuend), B (subtrahend), Bin (borrow in)

Outputs: D (difference), Bout (borrow out)

fullsubtractor

Equations:

Logical expression for difference:

Basic Expression for Difference (D):

D = A̅ B̅ Bin + A̅ B Bin̅ + A B̅ Bin̅ + A B Bin

Final simplified expression for Difference:

D = (A ⊕ B) ⊕ Bin

Logical expression for borrow:

Logical Expression for Borrow (Bout):

Bout = A̅ Bin + A̅ B + B Bin

Final expression:

Bout = Bin (A ⊕ B)̅ + A̅ B

Truth Table:

A B Bin D Bout
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 1
1 0 0 1 0
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1

9 Explain JK Flip-Flop with neat circuit diagram.

A JK flip-flop is a kind of sequential logic circuit which is able to store one bit of binary data. It contains two inputs, J(Set) and K(Reset) and two outputs, Q and Q̅. JK flip-flop has two configurations: Synchronous mode: The change of the output is only subject to the signal of the clock. Asynchronous mode: The output can be changed without the clock signal with the help of preset (PR) and clear (CLR) input. The circuit will be made of NAND gates with feedback on the inputs of the NAND gates. Due to this feedback connectivity, the JK flip-flop has removed the invalid state of the SR flip-flop. In the case of J and K equal to one, the flip-flop does not generate an invalid output. Instead, it toggles its state. The preset (PR) and clear (CLR) are to be forced to the output at 1 and 0 respectively regardless of the clock signal.

jkflipflp

Truth Table:

Inputs Outputs Comments
PR CLR CLK J K Q(n+1) Q'(n+1)
0 1 NA NA NA 1 0 Set (Preset)
1 0 NA NA NA 0 1 Reset (Clear)
1 1 0 NA NA Q(n) Q'(n) Initial Stage
1 1 1 0 0 Q(n) Q'(n) Initial Stage
1 1 1 1 0 1 0 Set
1 1 1 0 1 0 1 Reset
1 1 1 1 1 Q'(n) Q(n) Toggle

Explanation:

Working of JK Flip-Flop

  • J = 0, K = 0 (No change): The production is identical to the former condition.
  • J = 0, K = 1 (Reset): The output turns 0 no matter what it was previously.
  • J = 1, K = 0 (Set): The production is 1 irrespective of its previous condition.
  • J = 1, K = 1 (Toggle): The production level switches to the reverse.

Advantages of JK Flip-Flop

  • It is also flexible and can work in a synchronous and asynchronous mode.
  • It eliminates invalid condition existing in SR flip-flop.
  • It promotes toggle action when J = K = 1.
  • It is applicable in counters and memory circuitry.

Shortcomings of JK Flip-Flop

  • The circuit is complicated in that it uses more logic gates than other flip-flops.
  • Delays in propagation can also take place and this influences high speed applications.
  • When the width of the clock pulse is excessively large it suffers the race-around condition.

10 Explain the types of ROM.

ROM (Read Only Memory)

ROM (Read Only Memory) is a kind of non-volatile memory that is utilized in a computer system to hold the data and instructions that are permanent. When power supply is switched off, there is no loss of contents of ROM. Its primary use is in the storage of firmware, booting programs and system-level instructions to boot and operate the computer.

Types of ROM

ROMs exist in a number of types depending on the way data are programmed and erased:

1. Programmable Read Only Memory (PROM)

PROM is a form of ROM which is only programmed once by the user. The information once written into PROM cannot be modified or deleted.

Features:

  • Can be programmed only once
  • Data is permanent
  • Stored programs Are used to store fixed programs.

Application: Applied in electronic devices where the program is not required to be changed in any way.

2. Erasable Programmable Read Only Memory (EPROM)

EPROM is a form of ROM which is eraseable and rewritable. The data contained in the chip may be deleted by exposing the chip to ultraviolet (UV) light over a given period using a quartz window.

Features:

  • Can be erased using UV rays
  • Can be reprogrammed
  • Erases need special equipment to be removed.

Application: Employed in the systems where software changes are sometimes needed.

3. EEPROM (Electrically Erasable Read Only Memory)

EEPROM is a form of ROM and can be erased and reprogrammed without being taken out of the circuit, which is electrically possible.

Features:

  • Erased electrically
  • Reprogrammable
  • Faster than EPROM
  • Convenient than UV erasing.

Application: Smart cards are used in embedded systems, smart cards and in BIOS chips.

4. Flash ROM (Flash Memory)

Flash ROM is a superior form of EEPROM whereby the data is deleted and added in blocks as opposed to one byte at a time.

Features:

  • Faster than EEPROM
  • Ability to hold lots of information.
  • Low power consumption
  • Compact in size

Application: Placed in pen drives, memory cards, SSDs, and mobile phones.

Conclusion

  • ROM is one of the critical aspects in computer systems because it contains important system programs that are needed during booting and running.
  • ROMs of various types have been created in order to enhance flexibility and reusability.
  • Flash ROM is the most popular of all the types because it is fast, has a lot of storage space and can be reprogrammed.

Computer Science Fundamentals - Essential Concepts for B.Sc. in Computer Science

All content preserved from the original text with enhanced HTML formatting for better readability.

shape