About this ebook
Related to Computer Science II Essentials
Related ebooks
Computer Science I Essentials Rating: 5 out of 5 stars5/5Design And Analysis Of Algorithm Rating: 0 out of 5 stars0 ratingsLearn Operating System in 24 Hours Rating: 0 out of 5 stars0 ratingsIntroduction to Algorithms Rating: 0 out of 5 stars0 ratingsComputer Programming In C Language Rating: 4 out of 5 stars4/5Digital Electronics with Arduino: Learn How To Work With Digital Electronics And MicroControllers Rating: 5 out of 5 stars5/5Code Beneath the Surface: Mastering Assembly Programming Rating: 0 out of 5 stars0 ratingsEssential Algorithms: A Practical Approach to Computer Algorithms Rating: 5 out of 5 stars5/5Learn Java Programming in 24 Hours Rating: 0 out of 5 stars0 ratingsHistory Of Computers Rating: 0 out of 5 stars0 ratingsDigital Electronics, Computer Architecture and Microprocessor Design Principles Rating: 0 out of 5 stars0 ratingsLearn Design and Analysis of Algorithms in 24 Hours Rating: 0 out of 5 stars0 ratingsMastering Core Java: From Basics to Expert Proficiency Rating: 0 out of 5 stars0 ratingsThe Absolute Beginner's Guide to Binary, Hex, Bits, and Bytes! How to Master Your Computer's Love Language Rating: 5 out of 5 stars5/5Computer Security and Cryptography Rating: 5 out of 5 stars5/5The Art of Code: Exploring the World of Programming Languages Rating: 0 out of 5 stars0 ratingsProgramming for Everyone Rating: 3 out of 5 stars3/5Visualizing Data Structures Rating: 0 out of 5 stars0 ratingsMastering CUDA C++ Programming: A Comprehensive Guidebook Rating: 0 out of 5 stars0 ratingsSoftware Development Accelerated Essentials: What You Didn't Know, You Needed to Know Rating: 0 out of 5 stars0 ratingsPython Rating: 0 out of 5 stars0 ratingsAssembly Language Coding in Color: ARM and NEON Rating: 0 out of 5 stars0 ratingsExploring Computer Systems Rating: 5 out of 5 stars5/5Job Ready Java Rating: 0 out of 5 stars0 ratingsEveryday Data Structures Rating: 0 out of 5 stars0 ratingsSchaum's Outline of Data Structures with Java, 2ed Rating: 0 out of 5 stars0 ratingsIntroduction to Advanced Algebra Rating: 0 out of 5 stars0 ratingsSimple Computer Security: Disinfect Your PC Rating: 0 out of 5 stars0 ratings
Computers For You
The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution Rating: 4 out of 5 stars4/5The Invisible Rainbow: A History of Electricity and Life Rating: 5 out of 5 stars5/5The Professional Voiceover Handbook: Voiceover training, #1 Rating: 5 out of 5 stars5/5Standard Deviations: Flawed Assumptions, Tortured Data, and Other Ways to Lie with Statistics Rating: 4 out of 5 stars4/5Elon Musk Rating: 4 out of 5 stars4/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Slenderman: Online Obsession, Mental Illness, and the Violent Crime of Two Midwestern Girls Rating: 4 out of 5 stars4/5Deep Search: How to Explore the Internet More Effectively Rating: 5 out of 5 stars5/5Everybody Lies: Big Data, New Data, and What the Internet Can Tell Us About Who We Really Are Rating: 4 out of 5 stars4/5CompTIA Security+ Get Certified Get Ahead: SY0-701 Study Guide Rating: 5 out of 5 stars5/5Mastering ChatGPT: 21 Prompts Templates for Effortless Writing Rating: 4 out of 5 stars4/5An Ultimate Guide to Kali Linux for Beginners Rating: 3 out of 5 stars3/5Learning the Chess Openings Rating: 5 out of 5 stars5/5Uncanny Valley: A Memoir Rating: 4 out of 5 stars4/5Excel 101: A Beginner's & Intermediate's Guide for Mastering the Quintessence of Microsoft Excel (2010-2019 & 365) in no time! Rating: 0 out of 5 stars0 ratingsThe ChatGPT Millionaire Handbook: Make Money Online With the Power of AI Technology Rating: 4 out of 5 stars4/5Alan Turing: The Enigma: The Book That Inspired the Film The Imitation Game - Updated Edition Rating: 4 out of 5 stars4/5The Mega Box: The Ultimate Guide to the Best Free Resources on the Internet Rating: 4 out of 5 stars4/5A Brief History of Artificial Intelligence: What It Is, Where We Are, and Where We Are Going Rating: 4 out of 5 stars4/5Procreate for Beginners: Introduction to Procreate for Drawing and Illustrating on the iPad Rating: 5 out of 5 stars5/5How to Create Cpn Numbers the Right way: A Step by Step Guide to Creating cpn Numbers Legally Rating: 4 out of 5 stars4/5Some Future Day: How AI Is Going to Change Everything Rating: 0 out of 5 stars0 ratingsThe Hacker Crackdown: Law and Disorder on the Electronic Frontier Rating: 4 out of 5 stars4/5Data Analytics for Beginners: Introduction to Data Analytics Rating: 4 out of 5 stars4/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5Creating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5
Reviews for Computer Science II Essentials
0 ratings0 reviews
Book preview
Computer Science II Essentials - Randall Raus
SCIENCE
CHAPTER 1
Organization of a Computer
A computer manipulates data according to predefined rules or instructions stored in memory. Memory is organized into words containing n bits of information. The central processing unit (CPU) reads or writes one word at a time by addressing memory, then, when the memory is ready, either by reading that word or by writing new contents into that word. To perform this function, registers such as the memory address register (MAR) and the memory buffer register (MBR) are used.
Without some means of communication with the outside world, programs or data cannot be stored in memory. Therefore, input/output (I/O) devices are required. Figure 1.1 shows the basic organization of a computer. In the next three sections we will discuss in greater detail how the CPU, memory, and I/O actually work.
1.1 Central Processing Unit
Sometimes the central processing unit is presented as consisting of two parts: the control unit and the arithmetic logic unit (ALU). However, we will present the CPU as consisting of five main parts: instruction handling area, timing and control, address handling area, general purpose registers, and the ALU as shown in Figure 1.2.
Figure 1.1 Organization of a Computer
The address handling area consists of registers in which the addresses of program instructions or required data are stored. The addresses are transferred to the MAR at the appropriate time and the read or write is facilitated by the MAR.
The ALU is constructed from combinational devices such as parallel-adders and logic gates so that arithmetic and logic operations can be performed on the data in the CPU’s registers.
The instruction handling area consists of registers that contain the instruction currently being executed and the data needed to facilitate the execution of the current instruction.
The timing and control part, usually known as the control unit, sends out the appropriate clock-pulse to synchronize all components of the computer. The control unit also controls transfer of data between registers by control lines that go to the select lines of the bus system’s multiplexers and decoders. This unit also controls the operation of the ALU with control lines that are connected to the ALU function inputs.
Figure 1.2 Main Parts of the CPU
The general purpose registers contain data such as the results of ALU operations or data that is temporarily being stored by the CPU so that it can be used later.
1.1.1 The Arithmetic Logic Unit
Our arithmetic logic unit has five function inputs: addition, logical complement of data A, logical complement of data B, logical AND, and logical XOR as shown in Figure 1.3. Our ALU has one additional control unit input: carry-in C, which we define as arithmetically adding 1 to the result of any operation.
Figure 1.3 also shows general purpose registers A and B, the part of the bus line that transfers data between registers A and B and the ALU, and shift register SR, which receives the output of the ALU.
Figure 1.3 ALU, Shift Register, and General Purpose Registers A and B
The example below shows how the ALU in Figure 1.3 can be used to perform three additional operations that are not part of its function inputs.
EXAMPLE
Using the ALU in Figure 1.3, perform the following operations:
A–B (subtraction)
A + B (logical OR)
Test if A = B
First enable the B’ and C input functions to form the two’s complement. Next transfer the contents of SR back to B. Then add registers A and B.
First complement register A, transferring the results back to A. Then do the same to register B so they now both contain their complement. Now perform a logical AND on A and B (AND every bit in register A with the corresponding bit in register B). Next, transfer the result back to A and complement A. The SR register will now contain the logical OR of A and B by DeMorgan’s Law:
B′)′
Perform an XOR on A and B. The SR register will contain a zero if A = B.
The function inputs to the ALU and the select inputs to the bus system—which enable operations like those shown in the above example—come from the timing and control part of the CPU. Also coming from the timing and control part is the clock pulse. The clock pulse synchronizes the ALU operations and the bus transfers to and from registers. Each ALU operation takes one clock cycle, and each register transfer takes one clock cycle. These are called micro-operations, which will be explained more fully in Section 1.3.
1.2 Registers
Data stored in words in memory is usually relatively slow to access, about 3 or 4 clock cycles, so computers require high-speed registers that can be written to or read from in one clock cycle. These registers are on-board
or part of the CPU.
We will give brief explanations of the different types of registers, then show how they work, in the following sections. There are nine types of registers in the computer:
Program Counter (PC): This register holds the address of the next instruction to be executed. It will increment on the next clock-pulse when a function input is high—this function input comes from the control unit of the CPU. Since program instructions are stored in memory in sequential order, the PC is usually incremented once per instruction. The PC is part of the address handling area of the CPU in Figure 1.2.
Instruction Register (IR): This register holds the binary code of the instruction to be executed. The instruction register (IR) is part of the instruction handling area in Figure 1.2.
Memory Address Register (MAR): This register holds the address of the data to be accessed in RAM. Since memory is usually much slower than CPU registers, the MAR is considered neither part of the CPU nor the RAM, but sort of a go-between. The CPU can store an address in the MAR in one clock-pulse and the MAR can hold the address lines to the RAM for 3 or 4 clock-pulses until memory is accessed.
Memory Buffer Register (MBR): This register is used to transfer data to and from memory. Like the MAR, the MBR is neither part of the CPU nor the memory unit, but acts as a buffer between them. It can wait 3 or 4 clock-pulses for data to be accessed in the RAM, and transfer it to or from the CPU in