- Published on
- Published on
KembaraXtra-Case Law-Computer Hardware Overview
I. The Essence of a Computer: Programmability
I. The Essence of a Computer: Programmability
- Limitation of Hardware-Defined Features: Hard-wiring features into a circuit's design restricts innovation and modification after manufacturing.
- Programmability as a Key Differentiator: Computers can perform new tasks without hardware changes by accepting and executing instructions (a program).
- Hardware vs. Software:
- Hardware: Physical components of a computer (covered in this chapter).
- Software: Instructions that tell the computer what to do (covered in the next chapter).
- The ability to run software is what makes a computer a general-purpose device, instead of a fixed-purpose device
- Memory:
- Main Memory (RAM): The primary memory used in a computer.
- Volatility: Data is retained only while the computer is powered.
- Random Access: Any memory location can be accessed in roughly the same amount of time.
- A conceptual extension of simple memory devices like latches and flip-flops.
- Central Processing Unit (CPU):
- Also called a processor.
- Executes instructions specified in software.
- Can directly access main memory.
- Microprocessors: CPUs on a single integrated circuit (lower cost, improved reliability, increased performance).
- A conceptual extension of digital logic circuits.
- Necessity: Required for computers to interact with the outside world.
- Function: Facilitate communication into the computer (input) and out of the computer (output).
- Examples: Not explicitly mentioned in the provided text, but think of things like keyboards, mice, monitors, printers, network interfaces, etc.
- Published on
- Published on
- Published on
- Published on
KembaraXtra-Computer Science-SR Latch in a Vending Machine Circuit
I. Vending Machine Circuit with SR Latch
A. Requirements
A. Capacitor Basics
I. Vending Machine Circuit with SR Latch
A. Requirements
- Inputs:
- COIN button: Simulates coin insertion.
- VEND button: Initiates vending.
- Outputs:
- COIN LED: Indicates coin insertion.
- VEND LED: Indicates item vending.
- Functionality:
- Vending only occurs after coin insertion.
- Only one coin insertion is considered.
- Manual reset initially (later automatic).
- COIN Button:
- Sets the SR latch (COIN memory device).
- COIN LED turns on.
- VEND Button:
- AND gate: Requires both COIN (latch output = 1) and VEND button press.
- If both conditions are met:
- VEND LED turns on.
- If no coin was inserted: nothing happens.
- Reset:
- Manual reset required to clear COIN LED and reset the latch.
- Connects the AND gate output (VEND signal) to the Reset input of the SR latch.
- Intended behavior: Vending resets the coin memory.
- Problem: Reset happens too quickly. VEND LED barely turns on (or not at all).
- Problem: UI needs time for the user to see the action that has been performed
- Solution: Introduce a delay on the reset line.
- Implementation: Use a capacitor and resistor on the reset line.
A. Capacitor Basics
- Definition: An electrical component that stores energy.
- Terminals: Two terminals.
- Charging: Current flow charges the capacitor.
- Capacitance:
- Measure of charge storage ability.
- Unit: Farad (F). Commonly measured in microfarads (μF).
- Uncharged: Acts like a short circuit.
- Charged: Acts like an open circuit.
- Factors: Capacitance (C) and Resistance (R) in the circuit.
- Effect: Larger C and R = longer charging time = longer delay.
- Published on
KembaraXtra-Case Law-Designing with Logic Gates
Core Idea
Core Idea
- Complex logical statements/truth tables can be physically implemented using logic gates.
- Logical Statement: IF it is sunny AND warm, OR it is my birthday, THEN I am going to the beach.
- Simplified Statement: (A AND B) OR C
- Logic Gate Diagram:
- A and B are inputs to an AND gate.
- The output of the AND gate and C are inputs to an OR gate.
- The output of the OR gate is the final output.
- Functionality:
- If both A and B are 1, the AND gate outputs 1.
- If either the AND gate output or C is 1, the OR gate outputs 1.
- Definition: A circuit where the output is ONLY a function of the present inputs.
- Key Feature: A specific set of present inputs always produces the same output.
- Definition: The output is a function of both present and past inputs.
- Not covered in detail yet.
- Goal: Translate the truth table and logical expression (A OR B) AND C into a logic gate diagram.
- Steps:
- Create a truth table for (A OR B) AND C (refer to Chapter 2, Exercise 2-5 if needed).
- Draw a logic gate diagram:
- A and B are inputs to an OR gate.
- The output of the OR gate and C are inputs to an AND gate.
- The output of the AND gate is the final output.
- Published on
KembaraXtra-Computer Science-Binary Addition
Core Concept:
Binary addition follows the same principles as decimal addition, but uses base-2 (only 0 and 1).
Steps for Binary Addition:
Each binary addition operation produces two key outputs:
To verify your binary addition, you can convert the binary numbers to decimal, perform the addition in decimal, and then convert the decimal result back to binary.
Example:
0010 + 0011 = 0101
Conversion to Decimal for Verification:
Core Concept:
Binary addition follows the same principles as decimal addition, but uses base-2 (only 0 and 1).
Steps for Binary Addition:
- Start from the Rightmost Bit (Least Significant Bit): Just like decimal addition, begin with the rightmost column.
- Add the Bits in Each Column: Add the two bits in the current column. Remember these rules:
- 0 + 0 = 0
- 0 + 1 = 1
- 1 + 0 = 1
- 1 + 1 = 10 (which means 0 in the current column and carry-over 1 to the next column on the left)
- Handle Carry-Over:
- If the sum of two bits is "10", write down "0" in the current column and carry-over the "1" to the next column on the left.
- If there is a carry-over from the previous column, include it when adding the bits in the current column. (You could be adding 1 + 1 + 1, which equals binary 11, resulting in a sum of 1 and a carry-over of 1.)
- Repeat for All Columns: Continue adding each column, moving from right to left, until you've added all the bits, including any final carry-over.
- Final Carry-Over: If after adding the most significant bits there is still a carry-over, write it down to the left of your result.
Each binary addition operation produces two key outputs:
- Sum Bit (S): This is the result of the addition for the current column (either 0 or 1). This is the rightmost digit of the operation.
- Carry-Out Bit (Cout): This is the bit that is carried over to the next column if the sum of the current column is 2 (binary 10) or greater.
To verify your binary addition, you can convert the binary numbers to decimal, perform the addition in decimal, and then convert the decimal result back to binary.
Example:
0010 + 0011 = 0101
- Rightmost (LSB): 0 + 1 = 1
- Next Bit: 1 + 1 = 10 (0 with a carry-over of 1)
- Next Bit: 0 + 0 + 1 (carry-over) = 1
- Leftmost (MSB): 0 + 0 = 0
Conversion to Decimal for Verification:
- 0010 (binary) = 2 (decimal)
- 0011 (binary) = 3 (decimal)
- 2 + 3 = 5 (decimal)
- 0101 (binary) = 5 (decimal) - Confirmed!
- Published on
- Published on
KembaraXtra-Computer Science-Sequential Logic Circuits and Memory
1. What are Sequential Logic Circuits?
1. What are Sequential Logic Circuits?
- Definition: Digital circuits where the output depends on:
- The present inputs.
- The past inputs (history/state of the circuit).
- Key Feature: Possess "memory" of past events.
- Purpose: Stores a record of the circuit's past state.
- Function: Allows for the storage and retrieval of binary data.
- Importance: Enables sequential logic.
- Inputs: Coin slot, vend button.
- Behavior: The vend button only works if a coin has already been inserted.
- Why it's Sequential:
- The machine "remembers" (stores in memory) whether a coin has been inserted.
- The output (dispensing an item) depends on both:
- The present input (vend button press).
- The past input (coin insertion).
- Contrast with Combinational Logic: A combinational logic vending machine would require simultaneous coin insertion and button press.
- What Memory Stores: Binary data (bits).
- Units of Measurement:
- Bits: Basic unit of memory (0 or 1).
- Bytes: Groups of 8 bits.
- Modern Devices: Have large memory capacities (e.g., 1 GB = over 8 billion bits).