Eng:Computer Science

Computer science is a branch of science dealing strictly with computers, both physically and virtually. Computer science is very broad, as it has many aspects such as programming, hardware development and assembling, planning and mathematical incorporations into algorithms, etc. Scratch aims to teach kids programming, a branch of computer science for developing computer software, games, etc. Throughout the years, the studies of computer science have progressed greatly, as seen in the latest technology.

Programming
Programming deals with developing the code for programs to run properly on a machine for an end user. There are two main types of programming: text-based and object-oriented. Text-based programming languages require programmers to type in various codes based on a language's syntax. An object-oriented language uses visual objects and interpretations to make coding more relaxed and easy. Scratch is an object-oriented language, and utilizes the objects of blocks to program.

Hardware
Hardware refers to the physical parts that make up a computer. The main parts of a computer are its:
 * central processing unit (CPU)
 * graphics processing unit (GPU)
 * random access memory (RAM)
 * hard disk drive or solid state drive
 * power supply unit
 * motherboard
 * monitor (built-in or external depends on the machine)

Processors
The processor computes, analyzes, and manipulates data as well as performing complex calculations. Modern-day processors are known as micro-processors and are made mostly of silicon processed through complex machinery. Processors contain millions of transistors which act as switches for the logical circuits in which data is processed. Processors may have multiple cores, which act as multiple processors in one unit. Multi-core support allows for better multi-tasking. The cache of a processor is it's temporarily stored data for quicker access without having to redo an entire heavy calculation.

How a processor actually processes data is an extremely complex concept to understand on even its most basic level. Processors contain arithmetic-logic units, in which an input is received in the form of electricity (binary code), and the unit processes the data. The data, depending on many factors, can be sent to RAM, modify current RAM, or perform another type of process. Processors with a higher bit number such as a 64-bit processor have arithmetic-logic units that can processor a 64-bit sequence all in one cycle. The amount of cycles in a processor per second is referred to the clock rate and in modern-day is measured in GHz.

Misconceptions
Many people assume that the higher the clock rate of a processor, the more powerful that processor will be. This is a false misconception since many other factors affect how well a processor can carry out instructions in a given period of time. The clock rate of the processor is also known as the number of cycles or speed; in each cycle of the processor, numerous instructions can be carried out. A cycle can be thought of as a sequence of electricity that travels through transistor-transistor logic and performs calculations on data.

An old processor with the same clock rate as a newer processor will not perform as well because the amount of instructions carried out per cycle is less than the newer processor. This is known as the IPC, "instructions per cycle", of a processor. A good example is the comaparison of the modern-day Intel vs AMD processors. Intel processors typically are clocked lower than AMD processors but outperform them in single-core performance due to their higher IPC. This can be related to the number of transistors in a processor, as the more transistors that are present, the more instructions can be carried out within a single cycle of the processor. Processors usually have up to 2-3 billion cycles per second, often referred to as Ghz.

Furthermore, a major benefit of having a higher IPC over clock rate is less heat and electrical usage. If a processor is clocked higher, more electricity must be supplied in order for it to fulfill its number of cycles per second, resulting in more heat. However, if a processor can utilize a single cycle better without the necessity for more cycles to improve performance, it will save on both heat and electricity.

Graphics-Processing Units
While the processor calculates much data, controls artificial intelligence, and mathematical tasks, the graphics-processing unit's task is to render graphics. The graphics rendered by a GPU is displayed on a monitor through the video output. Though processors do render some graphics, highly intensive graphics like 3D gaming is rendered by the GPU. They take into effect shading, shadows, color, anti-aliasing, and more graphical effects. Using the GPU is often referred to as a form of hardware-acceleration, meaning all the hardware of a computer is being utilized for maximum performance in a game or program.

Some GPUs are built-in to the processor while others are external. The main GPU companies are Intel, Nvidia, and AMD. Intel's GPUs are typically built-in to their processors, often found in laptops. AMD also has many built-in graphics, too, but also has external GPUs, competing with Nvidia's GeForce graphics cards. Built-in GPUs are often found in laptops while external ones are usually in desktop computers due to a large volume of open space.

Memory (RAM)
Not to be confused with data stored on a hard drive, the random-access memory of a computer handles all the temporary data that controls the programs that are running and stores the temporary data requested by the processor. The hard drive is used for storing data permanately whereas the RAM of a computer only stores the information that is currently needed, such as the current value of a variable in a game. The more RAM a computer has, the more programs it can handle simultaneously without crashing.

Hard Drive
The hard drive stores all the permanent data of a computer ranging from the compiled, binary files that store the data for the entire operating system to run to small text files created by the end user. The hard drive feeds data into the RAM for the computer's memory to remember which programs are currently running and other temporary specifications. The only purpose of the hard drive is to store data permanately.

Solid-state drives are a type of hard drive which run on Flash storage instead of an actual disk. They are typically much faster and are more popularized as of recent. One downside to an SSD is the cost compared to that of an HDD.

Power Supply Unit
A power supply is the hardware that supplies a direct current (DC) of electricity to electronics. Primarily in computers, it's purpose is to take the alternating current (AC) (meaning a flow of electric charges with a fluctuation in voltage, or strength of electric fields) and convert it into stable direct current to be utilized by a computer. The power supply is one of the most overlooked components of a PC.

A power supply suits the purpose of "supplying power" to the various components as mentioned prior in this article. Any electrical current consists of an amperage and a voltage. A power supply not only converts AC to DC, but also adjusts the voltage level from that of the wall outlet (usually 110V-240V depending on the country). The voltages used by a computer are 3.3V, 5V, and 12V, as well as -5V and -12V (though they are becoming obsolete). The output and distinction of these voltages is known as a rail.

Quality power supplies are designed to filter transients, or surges and abnormalities, from the AC. They are also designed to ensure that no dangerous current is delivered back to the power grid, which could damage nearby electronics. Power supplies use various components ranging from ferrite coils, capacitors, integrated circuit boards and controllers, transformers, etc. Poorly designed power supplies often catch fire or even fry entire computers due to low-grade components used inside.

Motherboard
The motherboard is a printed circuit board with various slots, ports, sockets, and connectors to interconnect all the hardware of a computer together. A processor is placed into the socket on the motherboard and locked into place via a latch. Memory is inserted into DIMM slots on the motherboard. Hard drives and solid sate drives communicate with the motherboard via SATA cables. IDE cables are an older standard. M.2 solid state drives are utilizing a newer, faster form of communication than SATA. Graphics cards and other add-on cards are inserted into PCI and PCIe slots on motherboards. Power supply plugs are attatched in various locations to supply power to components.

Monitor
A monitor displays the video output sent by the computer and receives it as an input. Monitors vary in size and resolution, as well as the definition of colors available. Laptops have built-in monitors while desktop computers have external monitors, connected via a cable such as HDMI. Many operating systems support multiple monitors, so one computer can have a screen region expanded to a larger display, or simply duplicated.

Some of the more recent monitors have a 4K resolution and are even curved, though it can go up to 9999x9999 pixels via hacking the registry. Since 4K is not yet mainstream, some operating systems are not yet optimized to scale text properly on the screen. Therefore, objects that have sizes in relation to pixels rather than proportion may appear very small. Microsoft has tried to fix this issue in its latest operating system, Windows 10.

Networking
Networking is a branch of computer science that deals with the communications among computational devices either via wired connections or wireless. These data interactions can occur either locally or across the entire globe, also known as the Internet. Networking is important for businesses to sell their products, schools to centralize student information, and individuals to connect to the Internet and access websites.

Local-Area Networks
The term "network" become associated with computers once they are all connected to a router. This can be done through wired or wireless connections. Being connected to a router allows the computers to communicate with each other locally. An example of this would be a family all connected to one router, or a business. LAN networks are important for transferring files among nearby computers, playing others in computer games locally, and associating many devices with one access point to a larger, wide-area network.

When on an LAN network, each computer has an local IP address that uniquely identifies itself on the network. Without it, the router would not know what computer to transfer any data to. The router very often acts as a DHCP server, meaning it takes on the job of assigning IP addresses to the computers connected to it. Local IP addresses begin with  in which "X" varies for the device on the network. The router typically takes on a "1" in the final position.

Wide-Area Networks
Accessing the Internet is done through a wide-area network. The following outlines the basic steps performed when accessing a website:


 * 1. The computer, or client, sends a small bit of data to a router (if present), telling it the site it wants to access. The router remembers what computer asks for what sites based on the local IP address of the computer.
 * 2. The information passes through a modem which sends the information a long ways to a DNS server and through one's Internet Service Provider.
 * 3. If trying to access a site from its URL, the DNS servers have to associate that URL with its proper wide-area IP address (which is different than the reserved local area ones).
 * 4. The DNS servers request the given information from the proper web server, which is sent backwards to your modem, router, and computer.

Confusion can often arise over LAN and WAN IP addresses. LAN addresses are reserved addresses (meaning no WAN address can take on the same numbers) that are used solely for a local network and the communication of computers connected to one router. A WAN address is used to identify a router/modem on the Internet, across the entire globe.

Data transfer is done through waves when connecting to a web site. Computers cannot read waves but can only read exact binary code, encoded into their circuits. Therefore, data sent in the form of waves must be both encoded and decided in the process of wave-data transferring.

The largest Wide Area Network is the World Wide Web.

Ports and Packets
Ports are used to route incoming and outgoing traffic to not only the proper address but application at thay address. For example, a computer is both watching a video and playing an online game simultaneously. What prevents the data from getting mixed up that is sent to the client computer? All data on the Internet is sent in the form of a packet, or standardized format for properly sending data from one computer to another. A packet consists of the following: Internet Service Providers and other centralized servers can read the header information on packets and send them to the proper place. Packets only contain data they are intended for, so different applications send our different packets.
 * The sender's IP address
 * The destination IP address
 * The destination port number

The port is what maintains what particular software a packet of information is designated for. Whenever a website such as the Scratch Wiki is accessed, one's computer sends a request for a page on the site through port number 80. When the server receives the request, it recognizes port 80 and knows then to send back a web page. If it received a request on port 21 for instance, then a different software on the server would handle the request (in this case a file upload).

If the full local IP Address of the destination is not included in the packet yet the WAN IP address is included, a router is used to forward the request from a particular port to a certain local computer. For instance, a website can be accessed directly through the WAN IP address rather than a URL. However, that WAN IP address does not specify what server to request the data from. What is given is that port 80 is used, so the router at the WAN IP address can be programmed to forward a request on port 80 to a particular computer connected to that router. Then, the host can send data back to the client successfully in packet form.

Marketing
Computer science is one of the largest economic benefits to a country. Technology increases productivity and permits countries to increase their status and finance. One computer company Apple, according to Wikipedia, itself has grossed over $170 billion since its origins. Bill Gates, the owner of the computer company Microsoft, is typically the most or second-most rich man on earth. The United States in 2014 grossed a total revenue so far of $21 billion just in computer revenue sales. This is approximately over $70 per person in the nation dedicated to services of computers.

Large-scale computer companies such as Dell and HP help economies around the world through taxes and the sales of computers. These companies also provide thousands of jobs for individuals around the world. More jobs helps economies grow due to satisfaction with an individual's well-being and the government's income tax earnings. Without computers, a major economic opportunity would be passed up in which data calculations could not be done with high speeds, and leisure enjoyed by millions of people from computers would be diminished.