Punjab PSEB SS Computer Science study materials
Punjab PSEB SS Computer Science study resources

Punjab PSEB SS Computer Science: PSEB Senior Secondary Computer Science: Core Theory and Syntax

Punjab PSEB SS Computer Science · Work through your exam, one topic at a time.

All guide sections

PSEB Senior Secondary Computer Science: Core Theory and Syntax

This section covers the Computer Science content examined in the PSEB Senior Secondary (+2) theory paper: computer fundamentals and number systems, logic gates, operating-system and office-tool concepts, internet and networking basics, HTML, structured programming in C, and introductory database ideas. PSEB questions are usually direct definitions, conversions, syntax/output prediction, and short explanations, so exact terminology and correct syntax earn the marks.

Number systems and data representation

  • Place values are powers of the base, starting at 0 on the right.
  • Decimal to binary: repeated division by 2, read remainders upwards.
  • Group 4 bits for hexadecimal; 3 bits for octal.
  • 1's complement flips bits; 2's complement = 1's complement + 1; used for signed integers.

Logic gates and Boolean algebra

AND outputs 1 only when all inputs are 1; OR outputs 1 when any input is 1; NOT inverts. NAND and NOR are universal gates. De Morgan's laws: (A·B)' = A' + B'; (A+B)' = A'·B'.

C programming essentials

Every statement ends with a semicolon; C is case-sensitive. Format specifiers: %d int, %f float, %c char, %s string. Integer division truncates.

HTML and databases

An HTML document uses a skeleton of html, head, title, and body. Know container tags versus empty tags such as br and hr. In a table, tr defines a row and td defines a cell. A primary key uniquely identifies each record and cannot be null or duplicated.

Worked example: decimal 45 to binary and hexadecimal

Divide repeatedly by 2: 45 ÷ 2 = 22 remainder 1; 22 ÷ 2 = 11 remainder 0; 11 ÷ 2 = 5 remainder 1; 5 ÷ 2 = 2 remainder 1; 2 ÷ 2 = 1 remainder 0; 1 ÷ 2 = 0 remainder 1. Read remainders bottom-up: 101101₂. Check: 32 + 8 + 4 + 1 = 45. Group from the right into nibbles: 0010 1101, which is 2D₁₆.

Traps that cost marks

Confusing = (assignment) with == (comparison); writing 5/2 as 2.5 in C; reading binary remainders top-down; closing the empty tag br as if it were a container tag; and claiming a primary key may contain nulls.