8th Comp New Notes Ch2 and Ch3
8th Comp New Notes Ch2 and Ch3
1 pg-26
Q. What are the minimum and maximum values of whole numbers that can be stored in n bits?
Ans.
Numbe Bytes Minimum Minimum value in Formula Maximum value Maximum value in
r of bits value binary binary
n
4 1 nibble 0 0000 2n-1 24-1=15 1111
n
8 1 byte 0 00000000 2 -1 28-1=255 11111111
n 16
16 2 bytes 0 0000000000000000 2 -1 2 -1=65535 1111111111111111
32 4 bytes 0 0000000000000000 2n-1 232-1 1111111111111111
0000000000000000 =4294967295 1111111111111111
Topic 2.2.2.2, 2.2.2.3 pg-32
Q. What are the minimum and maximum positive signed integer values we can store in 1, 2 and 4 bytes?
Ans. While studying computer science Integers Z are referred to as signed integers. To store both positive and
negative value the most left bit also called most significant bit (MSB) is used as sign bit (SB), rest of the bits on right
are used to store the numerical value.
If we use 1 byte to store a signed integer
For 1 Byte: SB Numerical Value
0 1 1 1 1 1 1 1
Bytes SB Minimum value in Minimum value Formula Maximum value Maximum value in
binary in 7 bits binary in 7 bits
1 byte 0 0000000 0 2n-1-1 27-1=127 1111111
2 bytes 0 000000000000000 0 2n-1-1 215-1=32767 111111111111111
4 bytes 0 0000000000000000 0 2n-1-1 231-1 =2147483647 1111111111111111
000000000000000 111111111111111
11111010
+ 1
11111011
The result is equivalent binary number of -5.
-5= (11111011)2
Q. How to represent minimum value -128 in 8 bits binary using 2's complement method?
Ans. To represent -128 in 8-bit two’s complement, follow these steps:
0111 1111
+1
1000 0000
This is a special case because the MSB (most significant bit) is 1, indicating its negative, and there is no positive
counterpart since +128 is out of range for 8-bit signed numbers (which maxes out at +127).
Thus, the final 32-bit floating point binary representation of -0.15625 is:
1 01111100 01000000000000000000000
Final Answer
The single-precision (32-bit) representation of -0.15625 is:
Binary: 1 01111100 01000000000000000000000
Hexadecimal: BE200000
This is how -0.15625 is stored in 32-bit floating-point format in a computer.
Convert 0.15625 to binary by repeatedly multiplying by 2 and taking the integer parts:
(1 01111111100 0100000000000000000000000000000000000000000000000000)2
Step 8: Convert to Hexadecimal
Final Answer
Carry 11
101110
+ 1101
111011
1100
+ 1000
10100
11110111
Now add 1 to LSB.
111
11110111
+ 1
11111000
Carries 1111
00001100
+ 11111000
End carry 1 00000100 Discard the end carry
Q. Subtract 6 from 3.
Ans. 3
-6
-3
Step1: Convert minuend 3 into binary.
3 = (11)2
Complete 8 bits 3 = (00000011)2
Step2: Convert subtrahend 6 into binary.
6 = (110)2
Complete 8 bits 6 = (00000110)2
11111001
Now add 1 to LSB
1
11111001
+ 1
11111010
Carry 1
00000011
+ 11111010
11111101
If there is no end carry then take the 2’s complement of result again.
00000010
Now add 1 to LSB
00000010
+ 1
00000011
Put negative sign on the left side of the result -(00000011)2
We can write –(00000011)2 as –(11)2 that is -3 in decimal.
Final result is
-(11)2 = -3
1. Variable-Length Encoding
o Uses 2 bytes (16 bits) or 4 bytes (32 bits) per character.
2. Not Backward Compatible with ASCII
o Unlike UTF-8, UTF-16 is not compatible with ASCII because ASCII characters require at least 2 bytes.
1. Fixed-Length Encoding
o Every character, regardless of its Unicode range, is stored as a 32-bit (4-byte) integer.
2. Not Space Efficient
o Requires 4 bytes per character, making it inefficient for text-heavy applications.
o Uses more memory than UTF-8 or UTF-16.
3. Simple and Fast Processing
o Since every character is exactly 4 bytes, UTF-32 allows fast indexing of characters.
Q. What is pixel?
Ans. A tiny dot of an image is called pixel. It is the smallest element of an image. It has some properties like color,
position, shade etc. represented by numbers stored in computer.
Q. What is color representation of a pixel?
Ans. In color image the color of a pixel can be represented by three numbers. These three numbers represent Red,
Green and Blue (RGB) colors. The values of each these three numbers varies from 0 to 255. The variation of these
three numbers decides the color of a pixel. For example RGB value (255, 0, 0) will represent bright red color.
Q. What is quantization?
Ans. Digitizing the sample is called quantization. More bits per sample give good quality and high accuracy sound.
Q. What is frame rate? List different frame rates and their use.
Ans. Frame rate refers to the number of frames (images) displayed per second in a video. It is measured in frames
per second (fps). Different frame rates and their usage are given below.
• Movies & Cinematic Look → 24 fps
• TV Broadcast (U.S.) → 30 fps
• TV Broadcast (Europe & International) → 25 fps
• YouTube & Online Videos → 30 or 60 fps
• Sports & Fast-Action Videos → 50 or 60 fps
• Gaming (High-End Monitors) → 120 fps or higher
• Slow Motion Effects → 120 fps, 240 fps, or more
Ans.
• MP4 (MPEG-4 Part 14) is one of the most commonly used digital multimedia formats, designed to store
video, audio, subtitles, images, and metadata in a highly compressed and versatile container while
maintaining quality.
• AVI (Audio Video Interleave) is a video file format developed by Microsoft in 1992. It is known for storing
high-quality video and audio in a relatively simple container format. It is lossless and uncompressed format
resulting in large file.
• MKV (Matroska Video) is a flexible and open-source multimedia container format designed to store high-
quality video, audio, subtitles, and metadata in a single file. It is uncompressed and high quality video
format.
Q.6: What is the difference between Analog signal and Digital signal?
Ans: Comparison: Analog vs. Digital Signals
Feature Analog Signal Digital Signal
Nature Continuous Discrete (binary: 0s and 1s)
Precision More precise but prone to noise Less precise but resistant to noise
Storage Difficult (magnetic tapes, vinyl records) Easy (hard drives, SSDs, CDs)
Processing Requires analog circuits Uses digital processors and microcontrollers
Q.7: What is Analog to Digital Conversion (ADC)?
Ans: Analog to Digital Conversion (ADC) is the process of converting a continuous analog signal (such as sound,
temperature, or voltage) into a digital signal that can be processed by computers and digital devices.
Q.9: How ADC and DAC is performed in audio system using microphone and speaker?
Ans: In an audio system, Analog-to-Digital Conversion (ADC) and Digital-to-Analog Conversion (DAC) work together
to process sound. A microphone captures sound and converts it into a digital format, while a speaker takes the
digital data and converts it back into sound.
Step-by-Step Process
1. Audio Input – ADC Process (Microphone to Digital Signal)
➢ Microphone (Analog Signal Generation)
• A microphone picks up sound waves (continuous air pressure variations).
• The sound waves are converted into an electrical analog signal (voltage variations).
➢ Analog-to-Digital Converter (ADC)
• The analog electrical signal is converted into a digital signal through the ADC process:
• The digital audio data is now stored or processed and saved as an MP3 or other audio file.
2. Audio Output – DAC Process (Digital Signal to Speaker)
➢ Digital-to-Analog Converter (DAC)
• The stored/transmitted digital audio is converted back into an analog electrical signal:
1. Decoding – Binary data is converted into voltage levels.
2. Reconstruction – A smoothing filter removes sharp edges to form a continuous waveform.
➢ Speaker (Analog Signal to Sound Waves)
• The analog signal is amplified and sent to a speaker.
• The speaker’s diaphragm moves according to the waveform, producing sound waves that match the
original input.
Q.16: What are different logic operations (logic gates)? Write their truth tables.
Ans: Logic operations are fundamental in Boolean algebra and digital logic design. The main logic operations include
AND, OR, NOT, NAND, NOR, XOR, and XNOR. Each operation has a truth table, which shows how the inputs relate
to the output.
1. AND Operation (∙)
The AND operation returns true (1) only if both inputs are true.
Boolean Expression: A ⋅ B
Truth Table:
A B A∙B
0 0 0
0 1 0
1 0 0
1 1 1
2. OR Operation (+)
The OR operation returns true (1) if at least one of the inputs is true.
Boolean Expression: A + B
Truth Table:
A B A+B
0 0 0
0 1 1
1 0 1
1 1 1
A
A.B
B
C A’.B
Conclusion
Boolean functions are fundamental in computer science, from hardware design to software programming, AI,
security, and networking. Their ability to process binary decisions (0 and 1) makes them essential in all computing
applications.