Comp 100 Inner Tips
Comp 100 Inner Tips
operating system
An operating system (OS) is a software system that manages computer hardware and software
resources and provides common services for computer programs. It acts as an intermediary between
applications and the computer hardware, enabling them to communicate with each other.
Some examples of popular operating systems include Windows, macOS, Linux, Android, and iOS.
Input Devices:
1. Keyboard: A keyboard is an input device that allows users to input text and commands into a
computer by pressing keys.
2. Mouse: A mouse is an input device that allows users to control the movement of a cursor on
a computer screen.
3. Touchpad: A touchpad is an input device that allows users to control the movement of a
cursor by moving their fingers across a touch-sensitive surface.
4. Scanner: A scanner is an input device that allows users to digitize images, documents, and
other physical media.
5. Microphone: A microphone is an input device that allows users to input audio signals into a
computer.
Output Devices:
1. Monitor: A monitor is an output device that displays visual output from a computer.
2. Printer: A printer is an output device that prints text and images onto paper or other physical
media.
3. Speakers: Speakers are output devices that produce audio output from a computer.
4. Headphones: Headphones are output devices that allow users to listen to audio output
privately.
5. Projector: A projector is an output device that displays visual output from a computer onto a
large screen or wall.
Overall, input devices are used to input data into a computer, while output devices are used to
display or produce data that has been processed by the computer.
1. Decimal to Binary: To convert a decimal number to binary, you can use the following steps:
Divide the decimal number by 2, and write down the quotient and remainder.
Repeat the division process with the quotient until the quotient becomes 0.
Write the remainders in reverse order to get the binary equivalent.
2. Binary to Decimal: To convert a binary number to decimal, you can use the following steps:
Write down the binary number.
Starting from the rightmost digit, assign each digit a weight of 2 raised to the power of its
position (starting from 0).
Multiply each digit by its weight, and add up the results to get the decimal equivalent.
3. Decimal to Hexadecimal: To convert a decimal number to hexadecimal, you can use the
following steps:
Divide the decimal number by 16, and write down the quotient and remainder.
Repeat the division process with the quotient until the quotient becomes 0.
Write the remainders in reverse order to get the hexadecimal equivalent. Use the following
symbols for remainders 10 to 15: A, B, C, D, E, F.
4. Hexadecimal to Decimal: To convert a hexadecimal number to decimal, you can use the
following steps:
Write down the hexadecimal number.
Starting from the rightmost digit, assign each digit a weight of 16 raised to the power of its
position (starting from 0).
Multiply each digit by its weight, and add up the results to get the decimal equivalent.
Overall, the main characteristics of each generation of computers are improvements in processing
power, storage capacity, energy efficiency, and usability. Each generation builds upon the
advancements of the previous generation, leading to ever more powerful and sophisticated
computers.
cache memory
Cache memory is a type of high-speed memory that is used by a computer's processor (CPU) to
store frequently accessed data and instructions. It is designed to help speed up the computer's
performance by reducing the time it takes for the CPU to access data from the computer's main
memory (RAM).
The cache memory is typically a small amount of memory that is built into the CPU or located on the
motherboard close to the CPU. It is faster than RAM, but slower than the CPU's registers. There are
three main types of cache memory:
1. Level 1 (L1) Cache: This is the fastest type of cache memory and is built directly into the CPU.
It is used to store data and instructions that the CPU is currently working on. L1 cache is very
small, typically between 16 KB and 64 KB.
2. Level 2 (L2) Cache: This is a larger and slower type of cache memory that is located on the
motherboard close to the CPU. It is used to store data and instructions that the CPU is likely
to need in the near future. L2 cache can range from 256 KB to several megabytes.
3. Level 3 (L3) Cache: This is an optional type of cache memory that is located on the
motherboard and is shared between multiple CPU cores. It is used to store data and
instructions that are likely to be needed by any of the CPU cores. L3 cache can range from
several megabytes to tens of megabytes.
When the CPU needs to access data from memory, it first checks the cache memory. If the data is
found in the cache, it is called a cache hit and the data is retrieved from the cache memory. If the
data is not found in the cache, it is called a cache miss and the data is retrieved from the computer's
main memory. Cache memory helps to reduce the number of cache misses, which can significantly
improve the overall performance of the computer.
There are several types of registers in a CPU, each serving a specific purpose:
1. Program Counter (PC) Register: This register holds the memory address of the next
instruction that the CPU will execute.
2. Instruction Register (IR): This register holds the current instruction that the CPU is executing.
3. Accumulator (ACC) Register: This register is used to store intermediate results of calculations
and operations performed by the CPU.
4. Memory Address Register (MAR): This register holds the memory address of the data that the
CPU needs to access.
5. Memory Data Register (MDR): This register holds the actual data that the CPU has retrieved
from or written to memory.
6. Index Register (IX): This register is used to hold an offset value that is added to a memory
address to access a specific location in memory.
7. Stack Pointer (SP) Register: This register is used to keep track of the memory location of the
top of the stack.
8. Flag Register: This register contains a set of binary flags that indicate the status of the CPU
after an operation has been performed, such as whether the result of an operation was
negative or zero.
Registers are crucial to the operation of the CPU and play a key role in executing instructions,
performing calculations, and managing memory. They are designed to be very fast and are used to
store data and instructions that the CPU needs to access frequently. The size and number of registers
in a CPU can have a significant impact on the performance and efficiency of the computer.
main memory
Main memory, also known as primary memory or RAM (Random Access Memory), is a type of
computer memory that is directly accessible to the CPU (Central Processing Unit). It is used to store
data and instructions that the CPU needs to access frequently during program execution. Main
memory is volatile, which means that its contents are lost when the computer is powered off.
Main memory is typically made up of DRAM (Dynamic Random Access Memory) chips and is
organized into memory modules that are installed on the computer's motherboard. The size of the
main memory is an important factor in the computer's performance, as it determines the amount of
data and instructions that the CPU can access at any given time.
1. Volatility: As mentioned earlier, main memory is volatile, which means that its contents are
lost when the power is turned off.
2. Random Access: Main memory is randomly accessible, which means that any memory
location can be accessed directly by the CPU.
3. Speed: Main memory is very fast compared to secondary storage devices, such as hard drives
or solid-state drives, which makes it ideal for storing frequently accessed data and
instructions.
4. Capacity: The capacity of main memory is limited by the number of memory modules that
can be installed on the motherboard and the amount of memory that the motherboard can
support.
5. Cost: The cost of main memory has decreased over time, making it more affordable for
consumers and businesses.
Overall, main memory plays a critical role in the performance of a computer, as it is used to store
data and instructions that are accessed frequently by the CPU. It is one of the most important
components of a computer system and is essential for running programs and applications efficiently.
1. Volatile Memory: Volatile memory is temporary memory that requires power to retain its
data. It is the main memory used by computers to store data and instructions temporarily.
The two most common types of volatile memory are:
DRAM (Dynamic Random Access Memory): DRAM is the most commonly used type of
memory in modern computers. It is made up of memory cells that store a charge, which
represents a 1 or a 0. DRAM is relatively slow compared to other types of memory, but it is
inexpensive and provides a high level of storage density.
SRAM (Static Random Access Memory): SRAM is faster and more expensive than DRAM. It is
made up of memory cells that use flip-flops to store data. SRAM is used for cache memory
and other high-speed memory applications.
2. Non-Volatile Memory: Non-volatile memory retains its data even when power is turned off.
The two most common types of non-volatile memory are:
ROM (Read-Only Memory): ROM is a type of non-volatile memory that is programmed at the
factory and cannot be changed. It is used to store the computer's firmware, such as the BIOS
(Basic Input/Output System).
Flash Memory: Flash memory is a type of non-volatile memory that can be erased and
reprogrammed. It is used in devices such as USB drives, memory cards, and SSDs (Solid State
Drives).
Overall, the main differences between the types of main memory are their speed, cost, and ability to
retain data without power. Volatile memory is faster and less expensive than non-volatile memory
but requires power to retain its data. Non-volatile memory is slower and more expensive than
volatile memory but can retain data even when the power is turned off.
1. NOT Gate (Inverter) The NOT gate has one input and one output. It produces the opposite of
the input value. The symbol for the NOT gate is a triangle with a small circle at the input side.
Truth Table:
0 1
1 0
2. AND Gate The AND gate has two or more inputs and one output. It produces a logical "1"
only if all the inputs are "1". The symbol for the AND gate is a dot or a triangle with a small
circle at the input side.
Truth Table:
Input A Input B Output Q
0 0 0
0 1 0
1 0 0
1 1 1
3. OR Gate The OR gate has two or more inputs and one output. It produces a logical "1" if any
of the inputs is "1". The symbol for the OR gate is a plus sign or a triangle with no small circle
at the input side.
Truth Table:
0 0 0
0 1 1
1 0 1
Input A Input B Output Q
1 1 1
4. XOR Gate The XOR gate (exclusive OR) has two inputs and one output. It produces a logical
"1" if the inputs are different, and a logical "0" if the inputs are the same. The symbol for the
XOR gate is a plus sign with a circle around it.
Truth Table:
0 0 0
0 1 1
1 0 1
1 1 0
5. NAND Gate The NAND gate (NOT-AND) has two or more inputs and one output. It produces
a logical "0" only if all the inputs are "1". The symbol for the NAND gate is a dot or a triangle
with a small circle at the output side.
Truth Table:
0 0 1
0 1 1
1 0 1
1 1 0
6. NOR Gate The NOR gate (NOT-OR) has two or more inputs and one output. It produces a
logical "1" only if all the inputs are "0". The symbol for the NOR gate is a plus sign or a
triangle with a small circle at the output side.
Truth Table:
0 0 1
0 1 0
Input A Input B Output Q
1 0 0
1 1 0