Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Transcript

Computer Architecture Computer Architecture refers to the design and organization of a computer's fundamental components and the way these components interact to execute instructions. It encompasses both the hardware design and the structural layout of a computer system....

Computer Architecture Computer Architecture refers to the design and organization of a computer's fundamental components and the way these components interact to execute instructions. It encompasses both the hardware design and the structural layout of a computer system. 2 Essence of studying Computer Architecture 1. Understanding Hardware-Software Interaction Optimized Software Development Debugging and Troubleshooting 2. System Design and Performance Designing Efficient Systems Performance Tuning 3. Advancing Technology Innovation Emerging Technologies 4. Educational Foundation Core Knowledge for IT Professionals Problem-Solving Skills 3 Essence of studying Computer Architecture 5. Economic and Practical Impact Hardware Cost Efficiency 6. Security Considerations Vulnerability Assessment Designing Secure Systems 7. Career Opportunities Specialized Roles Cross-Disciplinary Applications 8. Informed Decision-Making Architectural Choices Future Planning 4 Evolution of Computer Started from Early Computing Devices Abacus (circa 500 BC) an ancient counting tool used for arithmetic operations. It consists of beads on rods and is considered one of the earliest tools for performing calculations. Antikythera Mechanism (circa 100 BC) an ancient Greek analog computer used to predict astronomical positions and eclipses. It is a sophisticated geared device found in a shipwreck off the coast of Antikythera, Greece. 5 Evolution of Computer Evolved into Mechanical Computing Devices Pascaline (1642) Blaise Pascal developed the Pascaline a mechanical calculator designed to perform addition and subtraction. Leibniz's Step Reckoner (1673) Gottfried Wilhelm Leibniz improved on Pascal’s design, creating a mechanical calculator capable of multiplication and division. 6 Evolution of Computer Evolved into Mechanical Computing Devices Difference Engine (1822) Charles Babbage designed the Difference Engine, an early mechanical computer intended to compute mathematical tables. Analytical Engine (1837) Charles Babbage conceptualized the Analytical Engine, a general-purpose mechanical computer. Although it was never completed, it had features such as an arithmetic logic unit and memory, which are fundamental to modern computers. 7 Evolution of Computer Evolved into Early Electronic Computing Devices (First Generation) Technology Vacuum Tubes Size Very large and bulky machines. Programming Machine language; programming was done in binary. Speed Slow compared to later generations. Examples Collosus, ABC, ENIAC, EDVAC, and UNIVAC I Advancements High heat generation, frequent hardware failures, and large physical size. 8 Evolution of Computer Early Electronic Computers Atanasoff-Berry Computer (ABC) (1937-1942) Developed by John Atanasoff and Clifford Berry, the ABC was one of the first electronic computers to use binary digits and electronic switches. It laid the groundwork for future computers but was not a general-purpose machine. Colossus (1943-1944) Designed by Tommy Flowers and his team, the Colossus was the world's first programmable digital computer. It was used during WWII to break encrypted German messages and was crucial in the development of computing technology 9 Evolution of Computer Early Electronic Computers (First Generation) ENIAC (Electronic Numerical Integrator and Computer) (1945) Developed by John Presper Eckert and John William Mauchly, the ENIAC was one of the first general-purpose electronic computers. It used vacuum tubes and was capable of performing a wide range of calculations. EDVAC (Electronic Discrete Variable Automatic Computer) (1949) Designed by Eckert and Mauchly, one of the earliest computers to implement the stored-program concept. Unlike its predecessors, which were programmed via hard- wired circuits or plugboards, the EDVAC used a stored program in memory to control its operations. 10 Evolution of Computer Early Electronic Computers (First Generation) UNIVAC I (Universal Automatic Computer I) (1951) Designed by Eckert and Mauchly, the UNIVAC I was the first commercially available computer. It marked the beginning of the computer age for business and government use. 11 Evolution of Computer Evolved into Transistor-based Computers (Second Generation) Technology Transistors Size Smaller and more compact than the first generation Programming Assembly language became more common; higher- level programming languages like COBOL and FORTRAN emerged. Speed Faster than the first generation. Examples IBM 1401, and DEC PDP-1 Advancements Reduced size, cost, and power consumption; improved reliability. 12 Evolution of Computer Second Generation (1950s – 1960s) DEC PDP-1 (Programmed Data Processor-1) (1960) A landmark machine in the evolution of computing technology. It provided a more accessible and interactive computing experience compared to its predecessors and had a lasting impact on the development of software and computer systems. IBM 1401 (1959) A significant computer system using transistors, the IBM 1401 was widely used in business applications. 13 Evolution of Computer Evolved into IC-based Computers (Third Generation) Technology Integrated Circuits (ICs) Size Even smaller and more efficient. Programming High-level programming languages became more sophisticated; operating systems like UNIX emerged. Speed Significantly faster and more capable.. Examples IBM System/360, DEC PDP-8 Advancements Increased processing power, enhanced reliability, and the introduction of multiprogramming and time-sharing. 14 Evolution of Computer Third Generation (1960s – 1970s) IBM System/360 (1964) Introduced the concept of compatibility across a range of models with different performance levels and used a unified instruction set. DEC PDP-8 (1965) Affordable, compact, and used for a variety of scientific and industrial applications. 15 Evolution of Computer Evolved into Microprocessor-based Computers (Fourth Generation) Technology Microprocessors Size Highly compact and affordable. Programming User-friendly operating systems and graphical user interfaces (GUIs); a wide range of high- level programming languages and software. Speed Much faster and more powerful. Examples Apple II, IBM PC. Advancements Personal computing became widespread, leading to the proliferation of home and office computers, development of software applications, and significant improvements in performance and user interfaces. 16 Evolution of Computer Fourth Generation (1970s – 1980s) Apple II (1977) Included color graphics and expansion slots; used for both home and business applications IBM PC (1981) Open architecture, supporting a wide range of peripherals and software; used Intel 8088 microprocessor. Established the standard architecture for personal computers and influenced the widespread adoption of PCs. 17 Evolution of Computer Evolved into Modern Computers (Fifth Generation) Technology AI, Neuromorphic and Quantum Computing, and Advanced Parallel Processing Size Varies widely from small embedded systems to large data centers. Programming Advanced programming models and languages, emphasis on parallel processing and real-time data analysis. Speed Extremely high performance; capable of handling complex and large-scale computations. Examples Google Quantum Computer (Sycamore), IBM Quantum Hummingbird, NVIDIA GPUs (for AI). Advancements Breakthroughs in computational power, development of new computing paradigms, and the integration of AI into various applications. 18 Evolution of Computer Fifth Generation (1980s – present) Google Quantum Computer (Sycamore) (2019) Achieved quantum supremacy by performing a specific computation faster than the most powerful classical computers. IBM Quantum Hummingbird (2021) Improved qubit count and error correction; designed for more complex quantum computations. Advances the field of quantum computing, contributing to the development of practical quantum algorithms and applications. 19 Evolution of Computer Fifth Generation (1980s – present) NVIDIA GPUs (2020s) High-performance architecture optimized for parallel processing, used in AI, machine learning, and graphics rendering. 20 Evolution of Computer Fifth Generation (1980s – present) NVIDIA GPUs (2020s) High-performance architecture optimized for parallel processing, used in AI, machine learning, and graphics rendering. 21 Activity No. 1 You are tasked to map the developments in Computer Architecture. Create a timeline which will effectively show the progress and evolution of computers starting from the manual devices up to the fifth generation. ADD A FOOTER 22 Computer System is an integrated set of hardware and software components designed to perform a range of tasks, from basic calculations to complex data processing and decision- making. It encompasses all elements required to achieve computing tasks and provide functionality to users. Functional Units functional units of a computer refer to the distinct components or subsystems that perform specific tasks necessary for the computer to operate effectively. These units work together to execute instructions, process data, and manage input and output operations. ❖ Central Processing Unit ❖ Memory Unit ❖ Input/Output System ❖ System Bus ❖ Motherboard ❖ Power Supply Unit ❖ Graphics Processing Unit Central Processing Unit is often referred to as the "brain" of a computer. It is the primary component responsible for executing instructions from computer programs, performing calculations, and managing the flow of data within the computer system. The CPU plays a critical role in determining the computer’s performance and capability. Roles of the CPU Instruction Fetching Instruction Decoding Instruction Execution Data Handling Control Operations Components of the CPU Arithmetic and Local Unit (ALU) Control Unit (CU) Registers Cache Memory Bus Interface Unit Processes of the CPU Fetch-Decode-Execute Cycle Fetch – retrieving instruction from the memory Decode - interpret the instruction to determine the required actions. Execute - Carry out the instruction using the ALU, registers, and other CPU components. Clock Speed Processes of the CPU Pipeline Processing Multicore Processing Importance of the CPU Performance Versatility Control Memory Unit is a crucial component responsible for storing and managing data and instructions. It plays a vital role in the operation of the system, allowing the CPU and other components to access and process information efficiently. Here’s an overview of the memory unit in a computer: Types of Memory Primary Memory Random Access Memory Cache Memory Secondary Memory Hard Disk Drives Solid State Drives Optical Drives USB Drives Virtual Memory Read-Only Memory Primary Memory RANDOM ACCESS MEMORY RAM is volatile memory. It provides fast, temporary storage for data and instructions that the CPU is currently processing. This includes the operating system, application programs, and active data. Types Dynamic RAM Static RAM Primary Memory CACHE MEMORY The purpose is to speed up data access for the CPU by storing frequently used instructions and data. Types L1 Cache – integrated in the CPU, very fast but limited in size L2 Cache – larger than the L1 but is still fast. Maybe integrated or on another chip L3 Cache – larger and slower than L1 and L2 Secondary Memory Hard Disk Drives (HDD) Hard Disk Drives (HDDs) are a type of storage device used in computers and other electronic devices to store and retrieve digital data. They are known for their relatively large storage capacity and cost-effectiveness compared to other storage types like Solid-State Drives (SSDs). Secondary Memory Solid State Drives (SSD) Solid-State Drives (SSDs) are a type of storage device that use flash memory to store data, offering several advantages over traditional Hard Disk Drives (HDDs). SSDs have become increasingly popular due to their speed, reliability, and efficiency. Here’s a comprehensive overview of SSDs. Secondary Memory Optical Drives Optical drives are hardware components used to read and write data on optical discs, such as CDs, DVDs, and Blu-ray discs. They have been a common feature in computers for media playback, data storage, and software installation. Secondary Memory USB Drives USB drives, also known as USB flash drives, thumb drives, or pen drives, are portable storage devices that use flash memory to store and transfer data. They are widely used for their convenience, portability, and ease of use. Virtual Memory Virtual memory is a memory management technique used by computer systems to extend the apparent amount of memory available to applications beyond the physical RAM (Random Access Memory). It enables a computer to run larger applications and multitask more efficiently by providing a larger address space than the physical memory alone. Read-Only Memory is a type of non-volatile memory used in computers and other electronic devices. Unlike RAM (Random Access Memory), ROM retains its data even when the power is turned off. Types of ROM Programmable Read-Only Memory (PROM) it can be programmed by the user once after manufacturing. ata is written to PROM using a special device called a PROM programmer. Once written, it cannot be altered. Types of ROM Erasable and Programmable Read- Only Memory (EPROM) can be erased and reprogrammed multiple times. Data is erased using ultraviolet (UV) light and reprogrammed. Useful for development and testing purposes. Types of ROM Electrically Erasable and Programmable Read-Only Memory (EEPROM) can be erased and reprogrammed electrically, without needing to remove the chip from the circuit. Allows for more convenient and flexible updating of data compared to EPROM. Modern EEPROMs can be reprogrammed many times. Activity No. 2 Make a deeper analysis of the Pipeline Processing capabilities of the CPU. Make a deeper analysis on how Multicore Processing works. ADD A FOOTER 44 Marinduque State University College of Engineering Department of Computer Engineering Activity No. 1 Evolution of Computers Chrisnell Joy C. Limpiada BSCpE-4 CPPC 23/23L Computer Architecture and Organization JAN ERROL B. MAMPUSTI August 13, 2024 I. Activity Questions Is the 4th Generation of Computers the last generation in the development of computer architecture? Did computers really start as huge machines? II. Objectives To determine whether the 4th Generation of Computers is the last generation in the development of computer architecture. To determine whether computers really did start as huge machines. III. Materials Laptop Internet Connection Canva Google IV. Procedures 1. Search a template of a design in canva that will be used for the map. 2. Search a timeline of the development of computer architecture. 3. Summarize the searched information and put it in the design you have in canva. V. Findings VI. Conclusion The 4th generation of computer, though the last year that belongs to it is unknown, is not the last generation of computers. There is also the 5 th generation which is about Low- Power and Invisible Computers. Computers have undergone so much evolution that it started as huge machines. Now there are computers that are portable. They may have smaller components or parts but their function was indeed more efficient. VII. References Oliveira, N. (2018, November 28). MILESTONES IN COMPUTER ARCHITECTURE. Sutori. https://www.sutori.com/en/story/milestones-in-computer-architecture-- TdSmmiw511xqr8w72LeKXZwx Marinduque State University College of Engineering Department of Computer Engineering Activity No. 2 Pipeline and Multicore Processing Chrisnell Joy C. Limpiada BSCpE-4 CPPC 23/23L Computer Architecture and Organization JAN ERROL B. MAMPUSTI August 15, 2024 I. Activity Questions What is the pipeline processing capabilities of the CPU? What is multicore processing? What are the similarities and differences of the pipeline and multicore processing? What is the importance of pipeline and multicore processing in the field of computer engineering? II. Objectives To identify the pipeline processing capabilities of the CPU To identify what is multicore processing To determine the similarities and differences of the pipeline and multicore processing To determine the importance of pipeline and multicore processing in the field of computer engineering III. Materials 10-peso coins for PisoWifi Laptop Internet Connection Google Microsoft Word IV. Procedures 1. Search about the pipeline processing capabilities of the CPU. 2. Search how a multicore processing works. 3. Search and analyze the similarities and differences of the pipeline and multicore processing. 4. Search the importance of the pipeline and multicore processing in the field of computer engineering. 5. Summarize and make a comprehensive report about pipeline and multicore processing and put them in a word file. V. Findings PIPELINE PROCESSING Pipeline processing is used in CPUs to enhance its performance through allowing multiple instructions to be processed Definition simultaneously at different stages of execution. Each stage of the pipeline can work on different instructions at the same time which increases throughput and efficiency. 1. Instruction Fetch: Retrieves the next instruction from memory. 2. Instruction Decode: Decodes the fetched instruction to determine its operation and operands. 3. Execute: Performs the arithmetic, logical, or data transfer Stages operations. 4. Memory Access: Reads or writes data from/to memory if necessary. 5. Write Back: Writes the result of the instruction back to the register file. Increased Throughput: The CPU can process more instructions per second by overlapping stages. Key Capabilities Improved Utilization: Various parts of the CPU are kept active and utilized efficiently. Reduced Average Instruction Execution Time: Although the Benefits time to complete each instruction individually remains the same, the overall throughput is enhanced, leading to better performance. Pipeline Hazards: Problems arise when instructions depend on Challenges the results of previous instructions, causing stalls or delays in the pipeline. Superscalar Execution: Allows the execution of multiple instructions in parallel within a single clock cycle. Out-of-Order Execution: Rearranges instructions to maximize pipeline efficiency and minimize stalls. Enhancements Branch Prediction: Predicts the outcome of branch instructions to prevent pipeline stalls. Cache Memory: Stores frequently used data closer to the CPU to reduce memory access time. MULTICORE PROCESSING Multicore processing involves integrating multiple independent processing units, or cores, onto a single chip. Each core can execute instructions independently, allowing for parallel processing. It enhances computing by providing faster, more Definition efficient, and versatile systems through parallel task execution. Its processes work concurrently wherein it works simultaneously on different tasks, enhancing overall performance and multitasking capabilities. Increased Performance: Parallel execution of tasks leads to faster processing speeds. Improved Multitasking: Smooth operation of multiple applications Benefits without noticeable slowdowns. Enhanced Energy Efficiency: Multicore processors often use less power than single-core processors with similar performance. Software Optimization: Not all software is optimized to fully utilize multiple cores. Heat Generation: More cores can increase heat output, Challenges necessitating effective cooling solutions. Complexity: Designing and manufacturing multicore processors is more complex than single-core processors. Dual-core: Two cores. Quad-core: Four cores. Hexa-core: Six cores. Configurations Octa-core: Eight cores. Higher Core Counts: For high-performance applications, processors can have even more cores. PIPELINE MULTICORE PROCESSING PROCESSING FOCUS: Optimizing the Contribute to FOCUS: Handling execution of a single faster multiple instruction instruction stream computing streams simultaneously Aim to improve APPROACH: Divides overall APPROACH: Uses instruction execution performance multiple independent into stages of a processor processing units (cores) RESULT: Increases Involves RESULT: Increases instruction throughput breaking down overall system of tasks into ANALOGY: Assembly performance smaller and line more ANALOGY: Multiple manageable assembly lines units IMPORTANCE OF PIPELINE AND MULTICORE PROCESSING IN THE FIELD OF COMPUTER ENGINEERING They form the backbone of modern processors as they drive advancements in performance, efficiency, and capabilities to handle complex computational tasks Pipeline Processing Multicore Processing Enhanced Performance: It significantly Increased Computational Power: It boosts processor speed through breaking provides a direct path to boosting down instruction execution into stages and computational power by distributing tasks overlapping their execution leading to across multiple cores which is essential for higher instruction throughput without handling complex workloads in fields like increasing clock speed scientific computing, data science, and Energy Efficiency: It contributes to artificial intelligence. reducing power consumption through Scalability: It offers a scalable approach to optimizing instruction flow which is crucial performance improvement, allowing for for mobile and embedded systems. gradual increases in processing power as Foundation for Modern CPUs: It is needed. employed virtually in all modern CPUs, Energy Efficiency: It can be more energy- making it a core concept for computer efficient than increasing the clock speed of engineers. a single core, making it suitable for power- constrained devices. Parallelism: It is fundamental to parallel computing, enabling the simultaneous execution of multiple tasks. VI. Conclusion The combined impact of pipeline and multicore processing is substantial. They enabled the development of high-performance systems capable of handling complex tasks, driving advancements in computer architecture. Pipeline processing is a technique that enhances CPU performance through dividing instruction execution into stages and overlapping these stages, resulting in increased throughput and efficient utilization of processor resources. Multicore processing, on the other hand, involves integration of multiple independent processing units (cores) onto a single chip, enabling parallel execution of tasks for improved performance and multitasking capabilities. Both pipeline and multicore processing are essential for modern computer engineering. Pipeline processing optimizes the execution of individual instructions, while multicore processing provides the foundation for parallel computing. These techniques can be utilized in the field of computer engineering as these will allow designing and developing innovative computing systems that meet the demands of modern applications and drive future technological advancements. VII. References Byju’s. (2022, July 4). Consider a pipelined processor with the following four stagesIF- Instruction FetchID- Instruction Decode and Operand Fetch EX- ExecuteWB- Write BackThe IF- ID and WB stages take one clock cycle each to complete the operation- The number of clock cycle for the EX stage depends on the instruction- The ADD and SUB instructions need 1 clock cycle and the MUL instructions need 3 clock cycles in the EX stage- Operands forwarding is used in the pipelined processor- What is the number of clock cycles taken to complete the following sequence of instructions- ADDR2-R1-R0R2 - R1 - R0MULR4- R3- R2R4 - R3 - R2SUBR6-R5-R4R6 - R5 - R4. https://byjus.com/question-answer/consider-a- pipelined-processor-with-the-following-four-stages-if-instruction-fetch-id-instruction- decode/ Can we illustrate a CPU pipeline with a UML sequence diagram? (n.d.). Software Engineering Stack Exchange. https://softwareengineering.stackexchange.com/questions/205623/can- we-illustrate-a-cpu-pipeline-with-a-uml-sequence-diagram GeeksforGeeks. (2022, April 26). Difference between Quad core and Octa core processors. GeeksforGeeks. https://www.geeksforgeeks.org/difference-between-quad-core-and-octa- core-processors/ GeeksforGeeks. (2023, April 15). Advantages and disadvantages of multicore processors. GeeksforGeeks. https://www.geeksforgeeks.org/advantages-and-disadvantages-of- multicore-processors/ GeeksforGeeks. (2023, April 19). Computer organization different instruction cycles. GeeksforGeeks. https://www.geeksforgeeks.org/different-instruction-cycles/ GeeksforGeeks. (2023, August 9). Computer Organization and Architecture Pipelining Set 1 (Execution, Stages and Throughput). GeeksforGeeks. https://www.geeksforgeeks.org/computer-organization-and-architecture-pipelining-set-1- execution-stages-and-throughput/ How does multi core computer enhance the performance? | 5 Answers from Research papers. (n.d.). SciSpace - Question. https://typeset.io/questions/how-does-multi-core-computer- enhance-the-performance-zb87mfud0h Marijan, B. (2023, December 11). Dual-Core vs. Quad-Core CPU: What’s the Difference? Knowledge Base by phoenixNAP. https://phoenixnap.com/kb/dual-core-vs-quad-core Pipelining. (n.d.). https://cs.stanford.edu/people/eroberts/courses/soco/projects/risc/pipelining/index.html Pipelining: “Instruction & Operations”, “Pipeline Stages.” (n.d.). Vaia. https://www.vaia.com/en- us/explanations/computer-science/computer-organisation-and-architecture/pipelining/ What you need to know about multicore processors. (2023, May 28). https://www.lenovo.com/ph/en/glossary/multicore-processor/ Wikipedia contributors. (2024, August 10). Multi-core processor. Wikipedia. https://en.wikipedia.org/wiki/Multi-core_processor Wikipedia contributors. (2024, July 10). Instruction pipelining. Wikipedia. https://en.wikipedia.org/wiki/Instruction_pipelining Marinduque State University College of Engineering Department of Computer Engineering Activity No. 3 4-Bit Arithmetic and Logic Unit Components Estrada, Carol Nicole L. Limpiada, Chrisnell Joy C. Lapinig, John Ryan J. Ureña, Ellsworth M. Jr. BSCpE-4 CPPC 23/23L Computer Architecture and Organization JAN ERROL B. MAMPUSTI, CpE September 03, 2024 I. Activity Questions 1. What is a 4-bit binary adder and how does it work in Logisim? 2. What is a 4-bit binary encoder and how does it work in Logisim? 3. What is a 4-bit binary decoder and how does it work in Logisim? 4. What is a 4-bit multiplexer and how does it work in Logisim? II. Objectives 1. To explore what a 4-bit binary adder is and how it works in Logisim. 2. To discover what a 4-bit binary encoder is and how it works in Logisim. 3. To determine what a 4-Bit binary decoder is and how it works in Logisim. 4. To identify what a 4-Bit multiplexer is and how it works in Logisim. III. Materials 1. Laptop or Mobile Phone 2. Internet Connection 3. Google/YouTube 4. Logisim 5. MS Word IV. Procedures 1. Divide the tasks and assign them to each member. 2. Each member must provide their own activity question and objective based on the assigned task to them. 3. Start searching about the task assigned to you, watch videos also for more information about the topic 4. Create a comprehensive report about the assigned topic. 5. Once the members are all done with the reports regarding the tasks assigned to them, these reports must be compiled in a single report. 6. Each member will be contributing in writing the conclusion for the said activity. V. Findings 4-BIT BINARY ADDER A 4-bit binary adder is a digital circuit designed to perform the addition of two 4-bit binary numbers. It consists of four full adder stages, each handling one pair of corresponding bits from the two input numbers and a carry-in bit from the previous stage. A full adder extends the concept of a half adder by including a carry-in bit. A half adder, shown in Figure 1, is a fundamental building block in digital circuits that performs the addition of two single-bit binary numbers. It has two inputs, A and B, and produces two outputs: the sum (S) and the carry (C). The sum is obtained using an XOR gate, and the carry is obtained using an AND gate. A full adder, shown in Figure 2, can add three single-bit binary numbers: A, B, and carry-in (Cin). It produces a sum (S) and a carry-out (Cout). Figure 1. Half Adder Circuit Figure 2. Full Adder Circuit Table 1. Components of a 4-bit Binary Adder COMPONENTS The 2 input bits are A and B, these are broken down into 4 to represent a 4-bit binary number: A0, A1, A2, A3: representing the first 4-bit 2 Input bits binary number. B0, B1, B2, B3: representing the second 4-bit binary number. The carry-in bit is written as Cin: 1 Carry-in bit Cin: representing the carry-in from a previous stage or external source. Each of the 4 full adders take three inputs (A, B, and Cin) and produce two outputs (Sum and Cout). A full adder is composed of half adders and an OR logic gate, a half adder also consists of logic gates which are the AND and XOR gates. Therefore, a full adder is composed of logic gates which are the following: 4 Full adders XOR gates: Used to perform the exclusive OR operation, which determines the sum bit. AND gates: Used to generate the carry-out bit and the carry-in bit for the next stage. OR gates: Used to combine the carry-out from the XOR gate and the AND gate to produce the final carry-out bit. The 2 output bits are S and Cout, the S is broken down into 4 to represent a 4-bit binary number: 2 Output bits S0, S1, S2, S3: representing the 4-bit sum of the two input numbers. Cout: representing the carry-out to the next stage or external circuit. How it works 1. Input processing: The corresponding bits from the two input numbers (A0 and B0, A1 and B1, etc.) are fed into the respective full adders. 2. Full adder operations: Each full adder performs the addition of its three inputs (A, B, and Cin) and generates a sum bit and a carry-out bit. 3. Carry propagation: The carry-out bit from one full adder is connected to the carry-in bit of the next full adder, allowing the carry to propagate through the circuit. 4. Output generation: The sum bits from all four full adders form the 4-bit sum output (S0, S1, S2, S3), and the carry-out bit from the final full adder is the overall carry-out (Cout). Figure 3. Truth Table of 4-bit Binary Adder Figure 4. Binary Calculator Figure 5. 4-bit Binary Adder Circuit The truth table and binary calculator, shown in Figures 3 and 4, can be used to verify the 4-bit binary adder created in Logisim, shown in Figure 5. The foundation of adding binary numbers is based on the following rules: 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10 (read as 0 carry 1). Figure 5 shows the addition of the 4-bit binary numbers 1011 and 0111. The bits are labeled as A0 to A3 and B0 to B3. When adding them, the aligned bits are added together. A0 and B0 are added to get S0, which is 1 + 1, resulting in 0 carry 1. The 0 is shown in S0, and the carry 1 is passed to the next full adder, which includes A1, B1, and S1. A1 plus B1 is 1 + 1, which equals 0 carry 1 again. However, we also have a carry 1 from the previous full adder, so we add 1 to 0 carry 1 (10 + 1), which is equal to 1 carry 1 (11). Thus, we put the 1 in S1, and the carry 1 is passed to the next full adder. This process continues until the last bit of the binary digits being added. It is important to remember that 1 + 0 and 0 + 1 both equal 1, while 1 + 1 equals 0 carry 1 (written as 10). Applications of a 4-bit Binary Adder Arithmetic logic units (ALUs): A fundamental component in computers and other digital systems, responsible for performing arithmetic operations. Digital signal processing (DSP): Used in various DSP algorithms for tasks like filtering, convolution, and modulation. Counters: Employed in digital counters to increment or decrement a binary value. Digital control systems: Utilized in control systems for various calculations and decision-making processes. 4-BIT BINARY ENCODER A 4-bit binary encoder is a digital circuit that converts a 4-bit binary input into a smaller number of bits. which is 2 or 3 bits. Each input line has a specific value, and when one line is active, the encoder outputs a binary code representing the input’s position. This process helps to reduce the number of output lines needed, making the data handling simple and more efficient in a digital system. The output binary code can then be used in various applications, such as selecting a specific line in a multiplexer, addressing memory locations, or controlling other digital circuits. Moreover, despite its advantages, if multiple inputs are active simultaneously, it may not work correctly which is the reason why sometimes they use priority encoder instead of 4-bit binary encoder. Table 2. Components of a 4-bit Binary Encoder COMPONENTS The encoder has 4 input lines labeled as D0, D1, D2 and Input bits D3. Each line corresponds to a specific binary value. The output is generally represented by a smaller number of Output bits bits which is usually 2 or 3 bits depending on the configuration. It is labeled as A and B. The encoder uses AND, OR and NOT logic gates to convert the active input line to binary input. The combination of these logic gates is what makes the encoder function correctly, turning inputs into binary output. OR GATES: check which input line is active and generate Logic Gates the corresponding binary code on the output lines. AND GATES: ensure that only the correct combination of input signal triggers a specific output. NOT GATES: invert signals which help to produce the required logic for the output. How 4-Bits Binary Encoder Works 1. Input Selection: The encoder receives a 4-bit input, but only one input line is active at any given time. The active input determines the binary output. 2. Encoding Process: The active input is encoded into a smaller number of output bits. For example, D2 is output therefore, the encoder will output a binary code representing the number 2. 3. Output: The output is the binary representation of the active input line. If more than one input is active at the same time, the encoder may produce incorrect or undefined results Figure 6. 4-Bit Binary Encoder Illustration and Truth Table The figure above shows the truth table and representation of a 4-bit binary encoder. Based on the figure, it shows that when the data input DO is at logic 1 and all other inputs are at logic 0, the encoded output will be BA=00. If D1=1 while other inputs are 0, the output will be BA=01. Similarly, when D3 = 1 and the rest of the inputs are 0, the output will be BA=11. Figure 7. 4-Bit Binary Encoder Circuit Figure 6 shows the truth table of the 4-bit binary encoder, which can be used to verify the corresponding circuit created in Logisim as shown in Figure 7. In Figure 7, when D1 has a value of 1 while D2 and D3 have values of 0, the output values are A is 1 and B is 0. Similarly, when D2 is 1 while D1 and D3 are 0 the output values of B is 1 and A is 0. Finally, when D3 is 1 and the others have a value of 0 the output value of both A and B is 1. Applications of 4-Bits Encoder Data Compression: Encoders reduce the number of bits needed to represent information, which is useful in data compression. Signal Multiplexing: Used in systems where multiple signals need to be encoded into fewer lines for transmission. Digital Circuit Design: Used in the design of digital systems, such as computers and communication devices, where encoding and decoding of data is necessary. 4-BIT BINARY DECODER A 4-bit Binary decoder is a digital circuit that decodes a 4-bit circuit that converts binary codes into a set of outputs. The binary codes serve as the inputs in order to determine the desired output. It will also be used to select the output that is active. Binary decoders are the inverse of encoders and are commonly used in digital systems to convert codes into sets of outputs. A 4-bit Binary decoder is a digital circuit that takes a 4-bit binary input (a combination of four 0s or 1s) and produces one of 16 possible output lines, each representing a unique decimal number from 0 to 15. Essentially, it acts as a translator, converting a binary code into its corresponding decimal equivalent. Table 3. Components of a 4-bit Binary Decoder COMPONENTS There are 4 input lines, typically labeled A, B, C, D. Each represents a single bit of the 4-bit Input Lines binary input. The combination of these inputs can represent any number from 0 to 15 in binary form. There are 10 output lines, Q0 to Q15, each corresponds to one of the possible 4-bit Output Lines combinations wherein only one of these output lines is active (high) at any given time, while the others remain inactive (low). The decoder uses a combination of AND, OR, and NOT gates to generate the correct output based on the input combination. Each output line is activated by a unique combination of the input lines. AND Gates: These gates are used to ensure that each output line is activated only by a specific Logic Gates combination of the input lines. NOT Gates: These gates invert the input signals as needed to ensure the correct combination of inputs activates the corresponding output. OR Gates: These gates can be used in more complex designs to combine multiple logic conditions. Figure 8 shows the 4-bit binary decoder truth table shows the relationship between a 4-bit input and a 16-bit output. Each input combination activates a single output bit, effectively decoding the input into a specific output. Inputs: A3, A2, A1, A0: These are the four input bits that can be either 0 or 1. Outputs: D15, D14, D13,..., D1, D0: These are the 16 output bits. Only one output bit will be 1 at a time, depending on the input code. The decoder takes a 4-bit input and activates the corresponding output bit. For example, if the input is 0001, the output D1 will be 1, and all other outputs will be 0. If the input is 1111, the output D15 will be 1. Figure 8. 4-Bit Binary Decoder Truth Table Figure 9. 4-bit Binary Decoder Circuit Figure 9 shows the circuit of a 4-bit binary decoder. In this example, a 4-bit input of 1 for A3, A2, and A1, and 0 for A0, produces an output of 1 for D14 and 0 for D0-D13 and D15. How it works A 4-bit binary decoder is a digital circuit designed to convert a 4-bit binary input into one of 16 unique outputs. This process is essential in various applications, such as memory address decoding and data multiplexing. 1. Inputs and Outputs: The decoder has 4 input lines and 16 output lines. Each unique combination of the 4 input bits corresponds to one specific output line being activated. 2. Operation: When a particular 4-bit binary value is applied to the inputs, the decoder activates the corresponding output line. For example, an input of 0101 (which is 5 in decimal) will activate the 6th output line. 3. Truth Table: The truth table for a 4-bit decoder lists all possible input combinations (from 0000 to 1111) and the corresponding output lines that will be activated. Only one output line is active at any given time. Applications Memory Address Decoding: In memory systems, a 4-bit binary decoder can be used to select one of 16 memory locations. Data Selection: It can be used in data selectors or multiplexers to route data from multiple sources to a single destination based on the binary input. Instruction Decoding: In microprocessors, a 4-bit binary decoder can decode the opcode of an instruction, determining which operation the processor should perform. Control Systems: It can be used to activate specific control lines based on the binary input, enabling the control of multiple devices with a single circuit. 4-BIT MULTIPLEXER A 4-bit multiplexer (also known as a MUX) is a digital switch that selects one of several input signals and forwards the selected input into a single output line. A 4-bit multiplexer selects one of the four 4-bit data inputs based on the selection inputs. Table 4. Components of a 4-bit Multiplexer COMPONENTS The data inputs are labeled as follows: 4 Data Inputs D0, D1, D2, D3 The selection inputs are used to select which input data line 2 Selection Inputs is sent to the output. They are labeled as: S0, S1 Output The output carries the selected input data, typically written as Y The gates that are typically used to implement the selection Logic Gates logic are the following: AND, OR, NOT How It Works: 1. Selection Inputs (S0, S1): The two selection inputs are used to choose which one of the four data inputs (D0, D1, D2, D3) is connected to the output. If S0 S1 = 0 0, D0 is connected to the output. If S0 S1 = 0 1, D1 is connected to the output. If S0 S1 = 1 0, D2 is connected to the output. If S0 S1 = 1 1, D3 is connected to the output. 2. Logic Gate Operation: The selection is made using a combination of AND, OR, and NOT gates. Each input line is ANDed with the corresponding selection lines. The output of these AND gates is then ORed together to produce the final output. 3. Final Output (Y): The selected 4-bit data from the chosen input line is forwarded to the output line. This selection is dynamically controlled by the selection inputs. Figure 10. 4-Bit Multiplexer Truth Table Figure 11. 4-Bit Multiplexer Circuit The truth table shown in Figure 11 can be used to verify the 4-bit multiplexer circuit created in Logisim which is shown in Figure 10. The figure shows the illustration of a circuit having S1 value as 1, S0 value as 0, and D2 value as 1. Given the following, the resulting or output (Y) value is 1. Applications Data Routing: Multiplexers are used to route data from multiple sources to a single destination. Memory Selection: In memory circuits, multiplexers are used to select memory addresses. Signal Control: They are used in digital signal processing to select different signal paths. Communication Systems: Multiplexers can be used in communication systems to select between different data streams. VI. Conclusion A 4-bit binary adder is a crucial digital circuit designed to perform the addition of two 4-bit binary numbers. It comprises four full adder stages, each responsible for processing one pair of corresponding bits from the two input numbers, along with a carry-in bit from the previous stage. This sequential carry propagation enables the adder to handle multi-bit numbers efficiently. In Logisim, the 4-bit binary adder demonstrates its functionality by using basic logic gates—AND, XOR, and OR—embedded within each full adder. Each full adder takes three inputs (two binary numbers and a carry-in bit) and produces a sum bit and a carry- out bit. These outputs facilitate accurate binary addition by managing the carry-over between adjacent bit positions. The 4-bit binary adder serves as a foundational building block for more complex arithmetic operations in digital circuits, such as those found in Arithmetic Logic Units (ALUs), digital signal processing, counters, and control systems. Understanding its workings not only enhances comprehension of basic digital arithmetic but also underscores its importance in the design and function of modern electronic devices. A 4-bit encoder is a digital circuit that converts four input lines into a smaller number of bits by outputting a binary code that represents the position of the active input line. In Logisim, the encoder is implemented using logic gates such as AND, OR and NOT to ensure accurate binary output when one input is active. For example, in the truth table where D1 is active, the encoder outputs BA=01. The circuit effectively reduces the number of the output lines needed, making data handling more efficient but it only requires one active input at a time to avoid the incorrect outputs which we can check through the truth table and testing in Logisim. Knowing the 4-bit binary encoder is useful for designing and optimizing digital services where efficient data management is crucial. This knowledge is important for understanding the concept of encoder, especially if you want to pursue computer engineering. A 4-bit binary decoder is an essential digital circuit that translates a 4-bit binary input into 16 different output lines. Each output corresponds to a specific combination of the input bits, ensuring that only one output line is active (logic high) at any given time, while all others remain inactive (logic low). This decoding process is fundamental in various applications, such as memory address decoding, data multiplexing, and digital systems requiring specific selection or control signals. A 4-bit multiplexer is a critical component in digital electronics, allowing the selection of one of four input data lines based on the combination of two select lines. By using basic logic gates, the multiplexer efficiently channels the desired input to the output, effectively reducing the need for multiple pathways. This ability to route and control multiple data inputs with minimal circuitry makes multiplexers essential in complex digital systems, such as data routing, communication systems, and microprocessors. Understanding how a 4-bit multiplexer operates provides foundational knowledge for designing more advanced digital circuits and systems. The 4-bit binary adder, encoder, decoder, and multiplexer are essential components in computer engineering, forming the building blocks of complex digital systems. The adder is crucial for performing arithmetic operations, which are fundamental in processors and digital signal processing. Encoders and decoders are vital for data compression, transmission, retrieval, and error detection, facilitating efficient data handling and communication. Multiplexers manage data flow by selecting specific inputs for output, optimizing resource use and data routing in control systems and memory management. Together, these components ensure efficient data processing and enhance the functionality, speed, and efficiency of modern computing devices. VII. References Binary Calculator. (n.d.). https://www.rapidtables.com/calc/math/binary-calculator.html Instructables. (2023, October 22). 4-Bit Binary Adder. Instructables. https://www.instructables.com/4-Bit-Binary-Adder-1/ GeeksforGeeks. (2023, May 6). Binary decoder in digital logic. GeeksforGeeks. https://www.geeksforgeeks.org/binary-decoder-in-digital-logic/ Nelson Darwin Pak Tech. (2021, October 15). 4 to 1 mux in logisim | 4 to 1 multiplexer in logisim | simulation of 4 to 1 mux in logisim [Video]. YouTube. https://www.youtube.com/watch?v=lo6E-bDnJtM Sing, A. S. (2022, October 12). What is Encoder? Operation of Binary encoder and Priority encoder. Electrically4U. https://www.electrically4u.com/what-is- encoder/#google_vignette Ancentus Tech. (2023, April 13). 4-BIT Binary Adder Simulation using LogIsIm - Digital Logic Tutorial [Video]. YouTube. https://www.youtube.com/watch?v=2HyXutXhZgE Solved To make a truth table for a mux, we could only write | Chegg.com. (n.d.). https://www.chegg.com/homework-help/questions-and-answers/make-truth-table- mux-could-write-rows-specific-input-selected-inputs-don-t-cares-4-1-multi- q69307233 Digital Electronics – Multiplexers. (n.d.). https://www.tutorialspoint.com/digital- electronics/digital-electronics-multiplexers.htm Teja, R. (2024, August 28). Multiplexer (MUX) and multiplexing (2 to 1, 4 to 1, 8 to 1 & 16 to 1). ElectronicsHub. https://www.electronicshub.org/multiplexerandmultiplexing/ Marinduque State University College of Engineering Department of Computer Engineering Activity No. 4 8-Bit Registers Estrada, Carol Nicole L. Limpiada, Chrisnell Joy C. Lapinig, John Ryan J. Ureña, Ellsworth M. Jr. BSCpE-4 CPPC 23/23L Computer Architecture and Organization JAN ERROL B. MAMPUSTI, CpE September 03, 2024 I. Activity Questions 1. What are the types of Register within the CPU? 2. How do clocks function in register circuitry? 3. What are latches? 4. What are flipflops? 5. How do registers store values? 6. What is the circuity of an 8-bit register? II. Objectives 1. To identify the types of register within the CPU. 2. To determine how clocks function in register circuitry. 3. To determine what latches are. 4. To determine what flipflops are. 5. To identify how registers store values. 6. To explore and understand the circuity of an 8-bit register. III. Materials 1. Laptop or Mobile Phone 2. Internet Connection 3. Google/YouTube 4. Logisim 5. MS Word IV. Procedures 1. Divide the tasks and assign them to each member. 2. Each member must provide their own activity question and objective based on the assigned task to them. 3. Start searching about the task assigned to you, watch videos also for more information about the topic 4. Create a comprehensive report about the assigned topic. 5. Once the members are all done with the reports regarding the tasks assigned to them, these reports must be compiled in a single report. 6. Each member will be contributing in writing the conclusion for the said activity. V. Findings REGISTER A register is a component of digital devices that stores data and instructions for quick processing. It serves as a temporary storage area where information can be accessed and manipulated quickly in order to carry out complex tasks. Registers are also used to execute programs and operations efficiently and this is done by giving access to commonly used values. The main purpose of a register is fast retrieval of data for processing the CPU. Types of Registers Accumulator (AC): This register is used to store intermediate results of arithmetic and logic operations. It plays a crucial role in the execution of instructions, as it temporarily holds data that is being processed. Memory Address Register (MAR): The MAR holds the address of the memory location that is to be accessed next. It is essential for fetching instructions and data from memory, ensuring the CPU knows where to look. Memory Data Register (MDR): Also known as the Memory Buffer Register (MBR), the MDR contains the data to be written to or read from the memory location specified by the MAR. It acts as a buffer between the CPU and the memory. General Purpose Registers (GPR): These registers are used for a variety of purposes, including holding temporary data and intermediate results during program execution. Examples include registers like R0, R1, and R2, which can be used for arithmetic operations, addressing, and more. Program Counter (PC): The PC keeps track of the address of the next instruction to be executed. It automatically increments after each instruction fetch, ensuring the CPU executes instructions in the correct sequence. Instruction Register (IR): This register holds the current instruction that is being decoded and executed by the CPU. It ensures that the CPU knows exactly what operation to perform next. Stack Pointer (SP): The SP points to the top of the stack, which is a special area of memory used for temporary storage during function calls and interrupts. It helps manage the call stack, enabling nested function calls and local variable storage. Flag Register: Also known as the status register, this register contains individual bits that indicate the status of the CPU or the outcome of operations. Flags such as Zero, Carry, Sign, and Overflow provide essential information for decision-making in programs. Figure 1. Basic Computer Architecture Figure 1 shows the diagram of a basic computer architecture. It showed the different components found inside a CPU and registers are some of it. Different types of register are seen inside a CPU, each having their own function or task but all have a common purpose, to store data. FUNCTION OF THE CLOCK IN REGISTER CIRCUITRY Clock signals in register circuitry function as a synchronization mechanism, ensuring accurate and reliable data transfers. They act as a reference point, indicating when data should be loaded into or read from the register. Clock signals also provide precise timing control, dictating the rate at which data is transferred between different parts of a circuit. Additionally, they enable edge-triggered flip-flops to operate accurately, allowing for proper data storage and transfer. The clock signal's consistent timing helps maintain the stability and integrity of data across the circuit. By providing a regular, predictable pulse, the clock ensures that all operations happen in a controlled sequence, avoiding conflicts and data corruption. This timing precision is essential for coordinating multiple registers and components, making sure they work together seamlessly within the system. Overall, the clock signal is fundamental for the orderly functioning of digital systems, guaranteeing that data is processed and transferred efficiently and without errors. LATCHES Latches are digital circuits designed to store a single bit of data and maintain its value until updated by new input signals. They serve as temporary storage elements in digital systems, holding binary information. Latches can be constructed using basic digital logic gates like AND, OR, NOT, NAND, and NOR gates. Latches play an important role in applications such as data storage, control circuits, and as components in flip-flop circuits. They are often combined with other digital circuits to form sequential circuits like state machines and memory units. Additionally, latches are valued for their simplicity and efficiency in systems that require high-speed data processing and minimal power consumption. However, since they operate without clock synchronization, their behavior can sometimes be less predictable, particularly in timing-sensitive applications. Types of Latches 1. SR Latch Set-Reset (SR) latches are the most basic type of latch, consisting of two inputs: S (Set) and R (Reset). The S input is responsible for setting the output to 1, while the R input resets the output to 0. However, when both inputs are set to 1 simultaneously, the latch enters an "undefined" or unstable state, which can cause unpredictable behavior. These states are sometimes referred to as preset and clear conditions. SR latches serve as the fundamental building blocks for more advanced flip-flops used in digital circuits. Table 1. SR Latch Truth Table S R Q Q’ 0 0 Latch Latch 0 1 0 1 1 0 1 0 1 1 0 0 Figure 2. NAND gate Logic Diagram Figure 3. NOR gate Logic Diagram Examples: S’ = R’ = 1 (S = R = 0) If Q = 1, Q and R’ inputs for 2nd NAND gate are both 1. If Q = 0, Q and R’ inputs for 2nd NAND gate are 0 and 1 respectively. S’ = 0, R’ = 1 (S = 1, R = 0) As S’ = 0, the output of 1st NAND gate, Q = 1 (SET state) In second NAND gate, as Q and R’ inputs are 1, Q’=0 S’ = 1, R’ = 0 (S = 0, R = 1) As R’=0, the output of 2nd NAND gate, Q’ = 1. In the first NAND gate, as Q and S’ inputs are 1, Q = 0 (RESET state). 2. Gated SR Latch A Gated SR latch is a type of SR latch that has an enable input. It works only when the enable input is 1, allowing the Set (S) and Reset (R) inputs to change the output. When the enable is 0, the latch keeps its previous state, ignoring any changes to the S and R inputs. Table 2. Gated SR Latch Truth Table Enable S R Qn+1 0 X X Qn 1 0 0 Qn 1 0 1 0 1 1 0 1 1 1 1 X Figure 4. Gated SR Latch Logic Diagram 3. D Latch D latches, also known as transparent latches, have two inputs: D (Data) and a clock signal. When the clock is high, the output copies whatever is on the D input. When the clock goes low, the output stops changing and holds its value until the clock goes high again. Table 3. D Latch Truth Table E D Q Q’ 0 0 Latch Latch 0 1 Latch Latch 1 0 0 1 1 1 1 0 Figure 5. D Latch Logic Diagram 4. Gated D Latch A D latch is a type of latch similar to an SR latch but with a simpler setup. It has one input called Data (D) and a clock signal. When the clock is high, the latch saves the value from the Data input. When the clock goes low, it keeps that value until the clock goes high again. Table 4. Gated D Latch Truth Table Enable D Qn Qn+1 STATE 1 0 X 0 RESET 1 1 X 1 SET 0 X X Q(n) No Change Figure 6. Gated D Latch Logic Diagram 5. JK Latch A JK latch has two inputs, J and K. It works by toggling its output when both J and K inputs are high. Unlike the SR latch, the JK latch avoids the undefined state issue, making it more reliable for digital circuits. Table 5. JK Latch Truth Table J K Qn+1 Comment 0 0 Q No Change 0 1 0 Reset 1 0 1 Set 1 1 Q’ Toggle Figure 7. Gated D Latch Logic Diagram 6. T Latch When the J and K inputs of a JK latch are connected together, it becomes a T latch. In a T latch, the output toggles (changes state) whenever the input is high. This means the T latch flips between its high and low states each time it receives a high input signal. Table 6. T Latch Truth Table T Q Q’ 0 0 0 0 1 1 1 0 1 1 1 0 Figure 8. T Latch Logic Diagram Table 7. Advantages and Disadvantages of Latches ADVANTAGES DISADVANTAGES No Clock Synchronization Easy to Implement Lack a clock signal to coordinate their Can be easily implemented using basic operations, which can lead to digital logic gates. unpredictable behavior. Potentially Unstable State Low Power Consumption May enter an unstable state if both inputs less power compared to other sequential are set to 1, causing unexpected system circuits such as flip-flops. behavior. Complex Timing High Speed The timing of latches can be complex and Function at high speeds, making them difficult to specify, making them less ideal for high-speed digital systems. suitable for real-time control applications. Cost-Effective They are inexpensive to produce, making them suitable for low-cost digital systems. Versatile Applications Latches are used in various functions like data storage, control circuits, and as part of flip-flops. FLIP FLOPS · In electronics, flip-flops and latches are circuits that have two stable states that can store state information – a bistable multivibrator. The circuit can be made to change state by signals applied to one or more control inputs and will output its state (often along with its logical complement too). It is the basic storage element in sequential logic. Flip-flops and latches are fundamental building blocks of digital electronics systems used in communications, and many other types of systems. Flip Flop Types 1. SR Flip Flop This is the most common flip-flop among all. This simple flip-flop circuit has a set input (S) and a reset input (R). In this system, when you Set “S” as active, the output “Q” would be high, and “Q‘” would be low. Once the outputs are established, the wiring of the circuit is maintained until “S” or “R” goes high, or power is turned off. Table 8. SR Flip Flop Truth Table S R Q(n+1) State 0 0 Qn No change 0 1 0 RESET 1 0 1 SET 1 1 x INVALID 2. JK Flip-Flop Due to the undefined state in the SR flip-flops, another flip-flop is required in electronics. The JK flip-flop is an improvement on the SR flip-flop where S=R=1 is not a problem. Table 9. JK Flip Flop Truth Table J K Q Q’ 0 0 0 0 0 1 0 0 1 0 0 1 1 1 0 1 0 0 1 1 0 1 1 0 1 0 1 1 1 1 1 0 Figure 9. JK Flip Flop Logic Diagram 3. D Flip-Flop D flip-flop is a better alternative that is very popular with digital electronics. They are commonly used for counters, shift registers, and input synchronization. Table 10. D Flip Flop Truth Table Clock D Q Q’ ↓»0 0 0 1 ↑»1 0 0 1 ↓»0 1 0 1 ↑»1 1 1 0 Figure 10. D Flip Flop Logic Circuit 4. T Flip-Flop A T flip-flop is like a JK flip-flop. These are single-input versions of JK flip-flops. This modified form of the JK is obtained by connecting inputs J and K together. It has only one input along with the clock input. Table 11. T Flip Flop truth table T Q Q (t+1) 0 0 0 1 0 1 0 1 1 1 1 0 Figure 11. T Flip Flop Logic Circuit HOW DO REGISTERS STORE VALUES? Registers within a CPU store values using a combination of flip-flops and control logics. Flip-flops are responsible for storing bits of information, either a 0 or a 1. A single flip-flop can only handle a single bit. By combining multiple flip-flops, a register can store larger binary values. Control logic coordinates the flow of data and instructions. It also handles operations like loading data into the register, storing data from the register, and performing arithmetic operations. When the CPU needs to store a value, it uses control signals to direct the data into the appropriate register. The flip-flops then hold this data until it is needed for processing. 8-BIT REGISTER CIRCUITRY Figure 12. Memory Cell In creating an 8-bit register, we must first create a memory cell because it is the basic building block that stores individual bits of data, allowing the register to store and manage multiple bits efficiently. Every memory cell contains 1 bit which is represented by a flip flop D, aside from the flip flop, it also contains a NOT, AND, OR gate as well as 5 inputs and 2 outputs. Figure 13. 8-bit Register Circuit (Complex) Figure 2 shows the circuit of an 8-bit register, which includes 8 memory cells, a clock, write enable, data input, reset, data output, and stored data. Each memory cell is a D flip- flop that stores one bit of data, with the clock synchronizing the data storage process. When the write enable (WE) signal is active, data from the data input (Din) lines is written into the register on the next clock pulse. The output enable (OE) signal controls when the stored data is available at the data output (Dout) lines, and the reset signal clears the register, setting all stored data to zero. Figure 14. 8-bit Register Circuit (Simple) Figure 3 shows a simpler version of the circuit in Figure 2 which focuses on the essential operations: data in Din is written to the register when WE is high and the clock pulses, stored in the register, and read when OE is high. If WE is low, data is not written despite clock pulses. The Dout displays the stored data when OE is high. The clock ensures synchronization, and the reset signal clears the stored data. VI. Conclusion CPU registers are essential in the functioning of a computer’s central processing unit. Each type of register serves a unique purpose: the Accumulator stores intermediate results of operations, while the Memory Address Register (MAR) and Memory Data Register (MDR) handle the addresses and data for memory access. General Purpose Registers (GPR) provide flexible storage for temporary data, enhancing the CPU’s ability to perform various tasks efficiently. The Program Counter (PC) ensures the sequential execution of instructions, and the Instruction Register (IR) holds the current instruction for processing. The Stack Pointer (SP) manages the call stack for function calls and interrupts, and the Flag Register provides critical status information about the CPU’s operations. Together, these registers enable the CPU to execute instructions swiftly and accurately, ensuring smooth and efficient data processing. Latches are designed to store a single bit of information. They maintain this data as long as needed until updated by new inputs, acting as temporary storage elements in larger digital systems. Latches come in different types which are SR (Set-Reset), D (Data), JK, and T latches which each of them have unique behavior. SR latch has two inputs for setting or resetting its state, while a D latch captures data when the clock signal is high. JK latches solve the instability issues of SR latches and toggle outputs, while T latches toggle between states based on input signals. Moreover, latches are great for devices like memory or battery powered systems. However, since they don't rely on a clock for timing, they can be unpredictable in tasks that need precise timing. Therefore, latches are affordable and effective but they must be used carefully in more complex designs. Flip-flops are critical components in digital electronics, forming the backbone of various memory elements and sequential logic circuits. They enable devices to store binary data and manage timing through synchronization with clock signals. Their different types (SR, D, JK, and T) provide flexibility in designing complex digital systems such as counters, registers, and memory storage. Understanding how flip-flops operate is fundamental for anyone involved in electronics or computer engineering. Registers in a CPU are fundamental components that store values using a combination of flip-flops and control logic. Flip-flops are electronic circuits capable of holding a single bit of data, and when combined, they form registers that can store larger binary values. Control logic manages the flow of data and instructions, ensuring that data is correctly loaded into and stored from the registers. These registers are crucial for the CPU’s performance because they provide the fastest type of memory access within the computer system. By holding data that the CPU is currently processing, registers enable quick execution of instructions and efficient handling of arithmetic and logic operations. This speed and efficiency are vital for the overall performance of the CPU, allowing it to execute complex tasks rapidly. The circuitry of an 8-bit register consists of eight memory cells, each built with a D flip-flop that stores one bit of data. These cells are synchronized by a clock, which controls when data is written or stored. The register has key control signals: Write Enable (WE) allows data from the data input (Din) to be written into the flip-flops when it is high; Output Enable (OE) determines when the stored data is available on the data output (Dout) lines; and Reset clears the stored data by setting all bits to zero. Logic gates (NOT, AND, OR) help manage the data flow and ensure proper coordination of these signals. The 8-bit register circuitry combines flip-flops, control signals, and logic gates to efficiently manage data storage, ensuring accurate and synchronized data handling within digital systems CPU registers are critical for efficient data processing, with each type serving specific roles, such as storing intermediate results, managing memory access, and controlling instruction execution. Latches store single bits, while flip-flops provide precise timing and synchronization, forming the building blocks of memory and sequential circuits. An 8-bit register, composed of eight flip-flops, stores a byte of data, with control signals like Write Enable, Output Enable, and Reset ensuring accurate data handling. Together, these components enable fast, synchronized data processing, making them essential for the smooth functioning of modern digital systems. VII. References Avik Dhali. (2023, March 19). 2. 8 Bit Register in Logisim. [Video]. YouTube. https://www.youtube.com/watch?v=CpkeKJIZmO0 GeeksforGeeks. (2024, June 12). Different classes of CPU registers. GeeksforGeeks. Retrieved from https://www.geeksforgeeks.org/different-classes-of-cpu-registers/ GeeksforGeeks. (2024a, May 20). Latches in digital logic. GeeksforGeeks. https://www.geeksforgeeks.org/latches-in-digital-logic/ Hopkins J. (2023). What is a Register in a CPU and How Does it Work? (2023, November 3). Total Phase Blog. Retrieved from https://www.totalphase.com/blog/2023/05/what- is-register-in-cpu-how-does-it-work/?srsltid=AfmBOop2IuoM- tjlA9ilcBawOG69ZmfbxLMYAlWqPIz5d3cnRMPE3HQ2 The importance of clock signals in register operations - FasterCapital. (n.d.). FasterCapital. https://fastercapital.com/topics/the-importance-of-clock-signals-in-register- operations.html

Tags

computer architecture hardware design computing evolution technology
Use Quizgecko on...
Browser
Browser