comp apps 5, 7, 8, 9

Vocabulary:

  • URL (Uniform Resource Locator): This is the address used to access a resource on the internet. It specifies the location of a resource and how to retrieve it, such as "https://www.example.com". It consists of the protocol (http/https), domain name, and optional path to a resource.

  • Search Engine: A search engine is a collection of programs that helps users find information on the web. Search engines use software to crawl the web and index web pages based on keywords, enabling quick retrieval of information when queries are submitted.

  • Web Crawler (Spider): This software program systematically browses the internet to discover web pages and adds them to the search engine's index. Crawlers follow links to find new or updated pages.

  • HTTP (Hypertext Transfer Protocol): This is the protocol used for transmitting web pages over the internet. HTTP facilitates the exchange of data between the client (browser) and the server, allowing users to view and interact with web content.

  • Boolean: Boolean refers to a type of logical operation that combines conditions using operators like AND, OR, and NOT. It is used in web searches to refine queries by including or excluding certain terms.

  • Logical Operators: These operators (AND, OR, NOT) are used in search engines to create complex queries. AND requires all terms to be present, OR allows either term, and NOT excludes certain terms from the search.

  • SSL/TLS (Secure Sockets Layer/Transport Layer Security): SSL and TLS are cryptographic protocols that provide secure communication over a computer network. Websites using HTTPS (Hypertext Transfer Protocol Secure) use SSL/TLS to encrypt data, ensuring privacy and security.

  • Page Rank: This is a system Google developed to rank web pages in search results. Pages are ranked based on the number and quality of links they receive, with highly linked pages considered more important.


5.1 How a Web Search Engine Works

A web search engine operates in two primary stages: crawling and indexing. The web crawler collects information from web pages, following links to new content. It builds an index of keywords found on these pages. When a user performs a search, the query processor matches the user's keywords with the indexed pages and returns a hit list of relevant results. The speed of results is due to the pre-built index.

5.2 Using Logical Operators and Filtering for Complex Queries

Logical operators such as AND, OR, and NOT help create specific searches. For example, using AND between terms ensures that both must appear on a page. OR allows for any of the terms to appear, and NOT excludes specific terms. These operators can also be combined for more nuanced searches, helping to narrow down or broaden search results based on user needs.

5.3 Google’s Page Ranking System as a Voting System

Google’s PageRank works like a voting system, where links from one page to another act as "votes" that increase the linked page's importance. Pages with more inbound links from other high-ranking pages receive higher ranks in search results. Importantly, links from higher-ranking sites are considered more valuable than links from low-ranking sites, affecting a page's overall position in the results.

5.4 Creating and Interpreting Venn Diagrams

Venn diagrams represent logical relationships between sets. In the context of search engines, they visually depict how search terms might overlap (AND) or differ (OR) across results. For example, an AND-query is represented by the intersection of sets, while an OR-query includes all areas of the sets.

MCQs:

1. Some web pages are “invisible.” That is, no search engine will return them in a query. Why do these pages exist? 

a. no other web page links to them b. they are synthetic c. they are file types browsers don’t understand d. all of the above 

2. The main responsibility of a crawler is to 

a. find web pages with false or illegal information b. count the number of web pages c. make sure lots of people visit certain pages d. build a list of tokens that are associated with each page

3. When picking additional sources you should choose 

a. independent sources b. sources created by the same author c. sources with the same domain name d. additional sources are never needed 

4. Enclosing search terms in quotes asks for pages with 

a. the search terms in any order b. the search terms in the exact order as written c. only the first word in the search terms d. only some of the words in the search terms 

5. When searching on Google, this is the same as using the AND keyword. 

a. + b. OR c. blank space d. − 

6. A primary source is 

a. something shared by a government b. a person with direct knowledge c. a teacher or a librarian d. the person who created the website 

7. Who is in charge of the World Wide Web? 

a. Vint Cerf b. Larry Page and Sergey Brin c. the United States government d. no one 

8. When should a researcher be skeptical of a primary source? 

a. never; primary sources are always credible b. when the primary source is only one person c. always; the researcher should verify the information from other sources d. about 50 percent of the time; it depends on the situation 

9. After finding the web page you want, what is the next question you should ask yourself? 

a. Is the information authoritative? b. When was the web page first published? c. Who owns this web page? d. Could I find this same web page using a different search engine?


SAQs

1. The higher the Page Rank is, the closer to the top of the list a web page will be in the returned results of a search query. 

2. Spaces in Google search queries are interpreted as AND. 

3. The main work of the crawler is to build an index. 

4. If a web page meets all the authoritative rules given in this chapter, it can still contain false information. 

5. Ctrl  F is the keyboard shortcut for finding certain words on a web page. 

6. Treating query terms as independent is almost always what you actually want. 

7. Wikipedia is validated by No one

8. Wikipedia is not considered a credible source. 

9. Crawlers crawl less than half of the Web. 

10. To find corroborating information on the Web, you should always cross check with another independent web page.


Exercises

  1. Why do we need search engines? What do search engines do? Answer both of these questions in great detail. 

    1. Web content is not organized. Search engines help us organize, find, and access information quickly and efficiently. Search engines consist of a collection of programs that crawl, index, and process queries, that allow users to search the internet for specific topics, keywords, or phrases by retrieving and ranking results from their massive index.

  2. Explain what a crawler is and what it does. 

    1. A crawler, also known as a web crawler or spider, is a program used by search engines to automatically browse the web and gather information about websites. Its main job is to visit web pages, follow links to other pages, and add the content it finds to the search engine's index.

  3. Explain the differences between the AND and OR logical operators and when you should use them in web searches. 

    1. When using AND all terms must be on the page; when using OR at least one or more terms can be on the page.

  4. Give three examples of when you would want to use quotes around your search query.

    1. Searching for a specific phrase

    2. Searching for book or movie titles

    3. Searching for famous quotes or sayings

  5. What is a cached page and how is it useful?

    1. It is a web page that is temporarily saved and stored by a web server as a backup copy. It is useful if the original page is not opening due to the website being down and is stored on powerful web servers so it can load faster.

Vocabulary:

  • Analog information: Analog information represents data in a continuous form. It can take on any value within a range, such as sound waves or temperature. Analog information is not limited to discrete values, making it more variable and detailed​.

  • Bit: A bit is the basic unit of information in computing, representing two possible states: presence or absence (1 or 0). It is the smallest unit of data that computers use​.

  • Byte: A byte consists of 8 bits and is a fundamental unit for storing and representing data. It is used to represent characters, such as letters, in computing​.

  • PandA (Presence and Absence): PandA refers to the encoding of information based on the presence or absence of a phenomenon, such as light or electricity. It is a foundational concept in binary representation​.

  • Metadata: Metadata is data that describes other data. It provides information about content, such as file size, creation date, or author, and is essential for organizing and interpreting digital information​.

  • List: A list is an ordered collection of items, often stored sequentially in memory. Lists are widely used in programming and data storage for organizing multiple elements​.


7.1 Explain the difference between representing digital information and representing analog information:

  • Analog Information: Represents continuous data that can have an infinite range of values. Examples include sound waves or temperature variations. Analog data is often more prone to degradation over time.

  • Digital Information: Represents discrete data using binary code (0s and 1s). Digital information is easier to process, store, and reproduce without loss of quality, allowing for perfect copies​.

7.2 Convert numbers in bases 2, 10:

  • Base 2 (Binary): Uses only two digits, 0 and 1. Each digit represents a power of 2.

    • Example: 

      • 1101 = (1×2^3) + (1×2^2) + (0×2^1) + (1×2^0) = 13

      • 101101 = (1x2^5) + (0x2^4) + (1x2^3) + (1x2^2) + (0x2^1) + (1x2^0) = 63 

  • Base 10 (Decimal): The standard numbering system with digits from 0 to 9, each representing powers of 10.

    • Example: 1310= (1×1000) + (3×100) + (1x10) + (0x1)

7.3 Explain the number of bits necessary to represent given decimal values:

  • n=[log2​(d+1)]

    • n is the number of bits required to represent a particular decimal number.

    • d is the decimal number you input. 

7.4 Explain the advantage of using hexadecimal numbers:

Hexadecimal (base-16) is advantageous because it is a compact way of representing large binary numbers. Each hex digit corresponds to 4 binary digits (bits). For instance, the binary sequence 10101111 can be written as AF in hexadecimal, making it easier to read and write​.

7.5 Explain the purpose of ASCII coding:

ASCII (American Standard Code for Information Interchange) is a character encoding standard that uses 7 bits to represent 128 characters, including letters, digits, punctuation marks, and control characters. ASCII enables consistent representation of text across different systems, ensuring compatibility​.

7.6 Describe one advantage of Unicode over ASCII code:

Unicode allows for a much larger range of characters (over 100,000), compared to ASCII’s 128 characters. This makes Unicode more versatile, supporting multiple languages and symbols, while ASCII is limited to basic English characters​.

Practice Questions:

1. How many symbols can be represented by four bits? 

a. 12 b. 16 c. 36 d. 256 

2. PandA representation is what kind of system? 

a. decimal b. binary c. hexadecimal d. byte 

3. What was used to help structure the digitized Oxford English Dictionary? 

a. bytes b. sets c. ASCII d. tags 

4. This defines how characters relate to each other when they are compared. 

a. digitizing b. binary sequence c. collating sequence d. information representation 

5. When using physical phenomena to encode information, name one potential solution if there are more than two alternatives. 

a. there is no solution b. adopt them all as present c. adopt one as present and all the other alternatives as absent d. adopt them all as absent 

6. Information describing information is called 

a. special information b. metadata c. special-data d. formatting 

7. K bits in a sequence yield how many symbols? 

a. K^2 b. 2^K c. K d. 2 

SAQ’s:

1. PandA is short for Present and Absent

2. Bumps and Pits encode information on DVDs and CDs. 

3. Hexadecimal is base 16

4. Grouping binary digits in groups of four makes converting to Hexadecimal easier. 

5. PandA is the name we use for the two fundamental patterns of digital information based on the presence and absence of a phenomenon. 

6. Information is said to be discrete, or distinct; there is no gray. 

7. The number of digits is the Base or the Radix of the numbering system. 

8. The more symbols you want, the more bits you need. 

9. Digitizing is representing information with symbols.

Vocabulary Terms:

  • RGB: RGB stands for Red, Green, and Blue. It refers to the three primary colors of light used to represent color in digital displays. Each color’s intensity is typically stored as a byte (8 bits), and varying the intensities of RGB produces different colors.

  • Pixel: A pixel is the smallest unit of a digital image or display. It consists of three subpixels (RGB), and each pixel's color is determined by the intensities of red, green, and blue lights.

  • Intensity: Intensity refers to how much a particular color (red, green, or blue) is emitted by a pixel. The higher the intensity, the brighter the color. Intensity is typically represented using an 8-bit binary number, ranging from 0 to 255.

  • Brightness: Brightness is the lightness or darkness of an image or pixel, determined by the overall intensity of the RGB values. Increasing brightness involves raising the RGB values of all pixels equally.

  • Contrast: Contrast refers to the difference in brightness between the darkest and lightest parts of an image. Increasing contrast increases the difference between these areas by adjusting the brightness of pixels.

  • Frequency: Frequency, in sound, refers to the number of waves (or cycles) per second. It is measured in Hertz (Hz) and determines the pitch of the sound.

  • Sample: In sound digitization, a sample is a measurement of the amplitude of a sound wave at a specific point in time.

  • Sampling Rate: The sampling rate refers to the number of times per second that a sound wave is measured during digitization. A higher sampling rate captures more detail and provides higher-quality sound.

  • Run-length Encoding: A compression technique used to reduce the size of image files by encoding sequences of identical data values (e.g., long strings of the same pixel color) as a single value and count.

  • Nyquist Rule: This rule states that the sampling rate must be at least twice the highest frequency present in the sound in order to capture it accurately.

  • Lossy Compression: A data compression method that permanently removes some data, typically the parts humans are less likely to notice, in order to reduce file size (e.g., JPEG, MP3).

  • Lossless Compression: A data compression method that reduces file size without losing any information, allowing the original data to be perfectly reconstructed (e.g., PNG, GIF).

  • Latency: Latency is the delay before a transfer of data begins following an instruction. In multimedia, latency refers to the time it takes for a video or sound to start or a webpage to load.

  • Bandwidth: Bandwidth is the amount of data that can be transmitted over a network in a given amount of time. Higher bandwidth allows more data to be sent or received per second, reducing latency.


8.1 Explain how RGB color is represented in bytes

RGB color is represented digitally using three components: red (R), green (G), and blue (B). Each color intensity is stored as an 8-bit number (1 byte), with values ranging from 0 to 255. The combination of these three colors at varying intensities produces a broad spectrum of colors. A full intensity for each (R=255, G=255, B=255) results in white, while zero intensity for each (R=0, G=0, B=0) results in black.

8.2 State the RGB representation of black and white

  • Black is represented as (R=0, G=0, B=0), which means all three color components are turned off.

  • White is represented as (R=255, G=255, B=255), which means all three color components are at full intensity.

8.3 Explain how modifying the value of the RGB components of a pixel could result in a shade of gray

A pixel's color becomes a shade of gray when the red, green, and blue components have equal intensity values. For instance, RGB (128, 128, 128) would produce a medium gray. As the RGB values increase or decrease equally, the pixel becomes a lighter or darker shade of gray. This occurs because gray represents a balance of all three colors, without dominance by any one component.

8.4 Explain how to increase the brightness of a photograph

To increase the brightness of a photograph, you can add a fixed value to each RGB component of every pixel. For example, if a pixel has RGB values of (120, 130, 140), increasing its brightness by adding 30 to each component results in (150, 160, 170). This shifts the overall intensity of the color towards white, brightening the image. It's important to ensure that the values don’t exceed 255, as this is the maximum intensity.

8.5 Explain how to increase/decrease the contrast of a photo

  • Increasing contrast: To enhance contrast, increase the difference between dark and light areas. This can be achieved by lightening the bright parts and darkening the shadows. For example, adjust pixel intensities using a scaling factor so that darker pixels change less and lighter pixels change more.

  • Decreasing contrast: This can be done by reducing the difference between dark and light areas, bringing the pixel values closer together, which makes the image look more flat and less defined.

8.6 Describe how a black and white photo can be “colorized”

Colorizing a black-and-white photo involves assigning different RGB values to the grayscale values. Typically, this is done by analyzing the intensity of the gray pixels and assigning color intensities based on their value. For example, darker areas might be colored blue or brown, while lighter areas could be given a sepia or pinkish hue. Advanced techniques often involve dividing the image into "highlights," "midrange," and "shadows" and then applying different color modifications to each region.

8.7 Explain how sound is digitized

Sound is digitized by converting continuous analog sound waves into a digital format using a process called sampling. The sound wave is measured at regular intervals (sampling rate), and each sample is stored as a digital value. This process is done by converting the amplitude (intensity) of the sound wave at each point into a binary number. For example, a common sampling rate for audio is 44,100 samples per second (44.1 kHz), which captures the sound wave at that frequency.

8.8 Describe the Nyquist Rule

The Nyquist Rule states that in order to accurately digitize an analog signal, the sampling rate must be at least twice the highest frequency present in the signal. For example, since humans can hear sounds up to 20,000 Hz, the sampling rate must be at least 40,000 samples per second to capture the full range of human hearing. In practice, digital audio often uses a sampling rate of 44,100 Hz to satisfy this rule and capture high-quality sound.

8.9 Explain the difference between lossy and lossless compression

  • Lossless compression: In lossless compression, the original data can be perfectly reconstructed from the compressed data. No information is lost during the compression process. An example is run-length encoding used in GIFs.

  • Lossy compression: In lossy compression, some of the original information is lost and cannot be fully restored. This is acceptable when the loss of information is not perceptible to humans, such as removing inaudible frequencies from an audio file in MP3 format or discarding subtle color differences in JPEG images. Lossy compression reduces file sizes more effectively than lossless.


Practice Questions:

1. Put the following binary values representing the intensity of green in order from least intense to most intense: 1111 1100, 1111 1111, 1100 0000, 1111 0000 

a. 1111 1100, 1111 1111, 1100 0000, 1111 0000 

b. 1111 1111, 1100 0000, 1111 0000, 1111 1100 

c. 1111 1111, 1111 1100, 1111 0000, 1100 0000 

d. 1100 0000, 1111 0000, 1111 1100, 1111 1111 

2. The RGB setting for blue is (0 is off, 1 is on) 

a. 0000 0000 0000 0000 0000 0000 

b. 1111 1111 0000 0000 0000 0000 

c. 0000 0000 1111 1111 0000 0000 

d. 0000 0000 0000 0000 1111 1111 

3. People tend to be sensitive to small changes in _____, but not to small changes in____. 

a. brightness, color b. color, brightness c. brightness, contrast d. color, contrast 

4. Analog information is 

a. discrete b. continuous c. random d. digital 

5. According to the Nyquist rule, the sampling rate for sound should be roughly 

a. half of what humans can hear b. the same as what humans can hear c. twice what humans can hear d. three times what humans can hear 

6. The accuracy of a digitized sound is determined by 

a. the sampling rate b. the precision of the sample c. the size of the digitized file d. all of the above 

7. A digital-to-analog converter 

a. changes digital information to analog waves b. converts continuous sound to digital sound c. converts sound to an electrical signal d. sets approximated values 

8. Do GIF files display vertical or horizontal bands better? 

a. vertical b. horizontal c. neither d. both 

9. Jessica Simpson’s “A Little Bit” is 3 minutes 47 seconds long. How many bits is this? 

a. 1,411,200 b. 40,042,800 c. 84,672,000 d. 320,342,400 

10. Raymond Kurzweil is known as the inventor of 

a. computer science b. text-to-speech generation c. image compression d. virtual reality

SAQ’s:

1. RGB values are usually stored as three bytes

2. Bandwidth is the limit that defines the maximum rate that information can be transmitted. 

3. All colors with equal intensities of RGB subpixels are either white, black, or shades of gray. 

4. Digital to Analog Conversion (DAC) is the term used when digital values are converted to create an analog sound. 

5. MP3 sound removes the highest and lowest samplings as part of its compression algorithm. 

6. Pixel color is determined solely by the intensity of the color. 

7. In OCR, each pixel is an estimate of how dark the corresponding area is. 

8. On the computer, compression means to store or transmit information with fewer bits. 

9. A process that allows the computer to “read” printed characters is called Optical Character Recognition

10. To increase the contrast of a photo, you should increase the difference between the light and dark parts. 

11. When converting analog sound to digital sound, using more bits yields a more accurate digitization. 

12. JPEG is to still images what MPEG is to motion pictures. 

13. The Bias Free Universal Medium Principle states that bits can represent all discrete information even though the bits have no meaning of their own. 

14. GIF images are limited to 256 colors.

Exercises: 

14. Provide three advantages of using digital sound over analog sound. Are there any disadvantages? Explain your answer in detail. 

  • Digital recordings have the ability to compute on the representation.

    • You can remove waves that are too high or too low for humans to hear, compressing the file.

    • You can overlay small errors made during the recording, like coughing.

    • You can change the pitch of your audio, using softwares like autotune.

15. Assuming you had a small file of 0’s and 1’s as follows, use run-length encoding to compress this file. 0000 0000 1100 0000 1111 1111 0011 1111 0011 1111 0000 0000 1100 0000 0000 0000 

  • 8 0’s, 2 1’s 6 0’s 8 1’s 2 0’s 6 1’s 2 0’s 6 1’s 8 0’s 2 1’s 14 0’s

16. MP3 is a lossy compression that loses some pieces of information. Why is it okay to lose this information?

  • The MP3 lossy compression technique works because most people cannot perceive any difference between the original and the compressed versions. This type of compression gets rid of sound that is too high or too low for humans to hear, etc; changes that are very hard for a human to detect. 

    Vocabulary: 

    • CPU (Central Processing Unit): The CPU, or processor, is the component in a computer responsible for executing instructions from programs. It performs basic arithmetic, logic, control, and input/output operations specified by the instructions​.

    • ALU (Arithmetic Logic Unit): The ALU is a part of the CPU that handles mathematical operations such as addition, subtraction, multiplication, and division, as well as logical operations like AND, OR, and comparison. It performs the actual computation in the instruction execution process​.

    • PC (Program Counter): The program counter is a register in the CPU that holds the memory address of the next instruction to be executed. It is incremented after each instruction is fetched during the Fetch/Execute cycle​.

    • I/O (Input/Output): I/O refers to the communication between the computer system and the external world, such as receiving input from peripherals (e.g., keyboard, mouse) or sending output to devices like a display or printer​.

    • Compiler: A compiler is a specialized program that translates code written in a high-level programming language (like C# or Java) into machine language (binary code) that a computer’s processor can execute​.

    • RAM (Random Access Memory): RAM is the computer’s primary memory, where programs and data that are currently being used are stored temporarily. It allows quick access to data in any order, facilitating fast program execution​.

    • Peripheral: A peripheral is an external device that connects to the computer to provide input, output, or additional storage. Examples include keyboards, printers, and external storage devices like USB drives​.

    • Secondary Storage (HDD vs SSD): Secondary storage refers to devices that store data persistently. HDD (Hard Disk Drive) uses spinning disks and mechanical parts to read/write data, while SSD (Solid State Drive) uses flash memory for faster access and durability, as it has no moving parts​.


    9.1 Explain the function of memory, control unit, ALU, I/O, and Program Counter:

    • Memory: Memory stores both the program being executed and the data on which the program operates. Each memory location has a unique address and stores values, often in the form of bytes. Programs fetch data from memory during execution, modify it, and return it back​.

    • Control Unit: The control unit is responsible for fetching instructions from memory, decoding them, and then controlling the execution of those instructions. It coordinates the activities of the processor, memory, and I/O units during the Fetch/Execute Cycle​.

    • Arithmetic/Logic Unit (ALU): The ALU performs arithmetic and logical operations, such as addition, subtraction, multiplication, and comparisons. It is the part of the computer that handles the actual computation of data​.

    • Input/Output (I/O): The I/O unit handles the communication between the computer and external devices like keyboards, monitors, and printers. Input devices bring data into the system, while output devices display or process the data​.

    • Program Counter (PC): The program counter keeps track of the memory location of the next instruction to be executed. After each instruction is executed, the PC is updated to point to the next instruction, allowing the processor to move sequentially through the program​.

    9.2 Explain the process of executing the instruction c = a + b:

    • CPU: The central processing unit (CPU) fetches the instruction c = a + b from memory and begins the Fetch/Execute Cycle to process it.

    • ALU: The arithmetic operation a + b is performed by the ALU, which retrieves the values of a and b from their respective memory addresses, adds them, and stores the result in the memory location assigned to c​.

    • Program Counter (PC): The PC identifies the memory location where the instruction c = a + b is stored. After the instruction is executed, the PC moves to the next memory location to fetch the next instruction​.

    • I/O: If either a or b is inputted by the user (e.g., via a keyboard), the I/O unit captures this input and makes it available to the ALU for processing. Similarly, once the result is computed, it might be sent to an output device like a monitor.

    • Compiler: A compiler translates high-level code (like c = a + b) into machine code that the processor can execute. The compiler converts the human-readable instruction into a series of machine instructions that can be carried out during the Fetch/Execute Cycle​.

    • RAM: Random Access Memory (RAM) temporarily stores the data values of a and b, the instruction itself, and the resulting value of c. These are fetched from or written to memory during the Fetch/Execute Cycle​.

    • Peripheral Devices: These are external devices, such as keyboards and displays, that may be used to input the values of a and b or display the result c.

    • Secondary Storage (HDD vs SSD): If the instruction c = a + b or the data values of a and b are stored on a hard disk drive (HDD) or solid-state drive (SSD), the processor retrieves the data from secondary storage, which is slower than accessing it directly from RAM. SSDs are faster than HDDs for reading and writing data​.

    Practice Questions:

    1. A machine instruction uses how many bytes of memory? 

    a. 1 b. 2 c. 4 d. 128 

    2. Converting code that a programmer writes into assembly code is called 

    a. compiling b. assembling c. F/E cycle d. Integrating

    3. What has made computers faster? 

    a. making everything out of silicon b. making everything smaller c. making everything farther apart d. making the F/E cycle more complicated 

    4. Which of the following is used for input and output? 

    a. keyboard b. hard disk c. mouse d. printer 

    5. The processor has how many moving parts? 

    a. too many to count b. 8 c. 2 d. 0

    6. From smallest to largest, the correct order of prefixes is 

    a. giga, kilo, mega, tera b. kilo, mega, giga, tera c. tera, kilo, mega, giga d. kilo, mega, tera, giga

    7. Modern computers know 

    a. only a few instructions b. a couple dozen instructions c. about a hundred instructions d. thousands of instructions 

    8. Rerunning a program with the same data produces 

    a. different results depending on the time of day b. exactly the same result every time c. different results depending on which computer it is run on d. the same results most of the time but sometimes it is different 

    9. If this.Opacity += 1.0; increases the opacity, what line of code would decrease the opacity? 

    a. this.Opacity = 1.0; b. this.Opacity –= 1.0; c. this.Opacity ++ 1.0; d. this.Opacity – – 1.0; 

    10. Which of the following characteristics of a computer depends on the number of Fetch/Execute Cycles it performs per second? 

    a. memory size b. price c. speed d. ALU


    SAQs: 

    1. Computers deterministically execute instructions to process information. 

    2. Without the Operating System, the processor is not capable of doing anything interesting

    3. RAM is an acronym for the name of the location where computer programs run and data is stored.

    4. The CPU part of the computer is the hardware part of the Fetch/Execute Cycle.

    5. In addition to fetching instructions, the F/E cycle also fetches data.

    6. The math in the computer is done by the ALU.

    7. The keyboard encodes keystrokes into binary form for the computer.

    8. The computer’s clock speed is measured in hertz/cycles per second.

    9. Every memory location has a(n) address.

    10. The Program Counter keeps track of the next instruction to execute

    11. Binary Object File is a long list of words, more accurately, a long series of 0’s and 1’s that make up a computer program

    12. A port is required for every peripheral connected to your computer.

    13. Operating System is a program that extends the operations a computer can perform beyond the hardwired machine instructions.

    Exercises:

    2. How many bits in a kilobyte? Megabyte? Terabyte? (Express as decimal numbers and as powers of 2.) 

    1 Kilobyte = 8000 bits

    1 Megabyte = 8,000,000 bits

    1 Terabyte = 8,000,000,000,000 bits

    3. Explain what an “idle loop” is in your own words. When does a computer start this kind of loop?

    When a computer finishes its work, it enters an idle loop, just checking to see if there are any external inputs

    5. Computers cannot read high-level programming languages. Explain how a programmer can be understood by a computer. 

    High-level language needs to be converted into the low-level language to make it understandable by the computer. We use a Compiler or interpreter to convert high-level language to low-level language.

    6. Explain the following instruction: ADD 3000, 1050, 1900. 

    It means to add the value in memory word 1050 to the value of the memory word 1900 and store the result in memory word 3000.

    7. List the five steps in the Fetch/Execute cycle, and describe each. Explain how these steps correspond to eating at a restaurant. 

    1. Instruction Fetch (IF):

    • Description: The control unit fetches the next instruction from memory based on the address stored in the Program Counter (PC).

    • Restaurant analogy: This step is like looking at the menu and deciding what to order. The menu represents the available instructions, and you choose which one (the instruction) to proceed with.

    2. Instruction Decode (ID):

    • Description: The fetched instruction is decoded to determine what action the computer must take. This is where the computer figures out which operation to perform and identifies any necessary data.

    • Restaurant analogy: Decoding is like telling the waiter your order. The waiter (the control unit) interprets your request (the instruction) to determine which dish you want and how it should be prepared.

    3. Data Fetch (DF) (also called Operand Fetch):

    • Description: The necessary data is fetched from memory or input devices, and the values required for the operation are retrieved and placed in the Arithmetic/Logic Unit (ALU).

    • Restaurant analogy: This is when the kitchen gathers the ingredients needed to prepare your meal. The kitchen (memory) fetches the ingredients (data) to start cooking.

    4. Instruction Execute (EX):

    • Description: The ALU performs the operation specified by the instruction, such as addition, subtraction, comparison, etc. This is the actual computation step.

    • Restaurant analogy: This step is like the chef cooking the meal. The chef (ALU) processes the ingredients and performs the necessary operations to prepare the dish (execute the instruction).

    5. Result Return (RR) (also called Store):

    • Description: The result of the operation is stored back in memory or sent to an output device, completing the instruction. The cycle is then ready to start again with the next instruction.

    • Restaurant analogy: This is like the waiter delivering your meal to the table. The finished dish (result) is served to you, completing the process.

    8. A megabyte is 1,048,576 bytes. Explain why it is not 1,000,000 bytes. 

    Every byte must have an address; one million addresses requires 20 bits, but 2^20 totals 1,048,576, so extra bytes are included to match the number of addresses. 




robot