0% found this document useful (0 votes)
15 views16 pages

Hardware and Software Basics

The document provides an overview of the fundamental differences between hardware and software components in computer systems, emphasizing their interdependence. It explains the roles of various hardware components like the CPU, memory, and input/output devices, as well as the types of software including system, programming, and application software. Additionally, it introduces key programming concepts, languages, and the importance of data structures and algorithms in software development.

Uploaded by

ratheesahil4720
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views16 pages

Hardware and Software Basics

The document provides an overview of the fundamental differences between hardware and software components in computer systems, emphasizing their interdependence. It explains the roles of various hardware components like the CPU, memory, and input/output devices, as well as the types of software including system, programming, and application software. Additionally, it introduces key programming concepts, languages, and the importance of data structures and algorithms in software development.

Uploaded by

ratheesahil4720
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Computer science 101: Hardware vs software components

Hardware and software are essential parts of a computer system. Hardware


components are the physical parts of a computer, like the central processing unit
(CPU), mouse, storage, and more. Software components are the set of
instructions that we store and run on our hardware. Together, they form a
computer.

If you are new to computer science, it’s important to understand hardware and
software components. This is the foundation of any computer science journey.

Today, we will be diving into hardware and software and teach you how they
relate to a computer’s memory, CPU, and more.

Hardware vs. Software

Software describes a collection of programs and procedures that perform tasks


on a computer. Software is an ordered sequence of instructions that change the
state of a computer’s hardware. There are three general types of software:

 System software
 Programming software
 Application software

When you think of computer science, software is probably what comes to mind.
Software is what developers actually code. Those programs are then installed
onto a hard drive.

Hardware is anything physically connected to a computer. For example, your


display monitor, printer, mouse, and hard drive are all hardware components.
Hardware and software interact with each other. The software “tells” the
hardware which tasks to perform, and hardware makes it possible to actually
perform them.

Note: Most computers require at least a hard drive, display, keyboard, memory,
motherboard, processor, power supply, and video card to function.

Hardware Software

Physical devices that store and Collection of coded instructions that


run software all us to interact with a computer

Works as the delivery system Performs specific tasks

Monitor, printer, scanners,


Adobe, Google Chrome, Microsoft
label makers, routers and hard
Excel, Spotify
drive

Hardware begins functioning Software must be installed on


when software is loaded. hardware
Hardware Software

Software will not wear down, but it is


Hardware will wear down over
vulnerable to bugs / becoming
time
outdated

Hardware components

Now that we understand the difference between hardware and software, let’s
learn about the hardware components of a computer system. Remember:
hardware includes the physical parts of a computer that the software instructs.

CPU

The Central Processing Unit (CPU) is a physical object that processes


information on a computer. It takes data from the main memory, processes it,
and returns the modified data into the main memory. It is comprised of two sub-
units:
 The control unit (CU): controls data flow from and into the main memory
 The arithmetic and logic unit (ALU): processes the data

This computer architecture design, created by John von Neumann in 1945, is still
used in most computers produced today. The Von Neumann architecture is based
on the concept of a stored-program computer. Instruction and program data are
stored in the same memory.

This architecture includes the following components:

 Control Unit
 Inputs/Outputs
 Arithmetic and Logic Unit (ALU)
 Memory Unit
 Registers

The Von Neumann Architecture.

Input and output units

The input unit takes inputs from the real world or an input device and converts
that data into streams of bytes. Common input devices include a keyboard,
mouse, microphone, camera, and USB.
The output unit, on the other hand, takes the processed data from the storage of
CPU and represents it in a way a human can understand. Common output devices
include a monitor screens, printers, and headphones.

Storage Units

After the data is retrieved and converted, it must be stored in the memory. The
storage unit or memory is the physical memory space. It is divided into byte-sized
storage locations.

(A kilobit (kb) is 1,024 bits, A megabyte (MB) is 1,024 kilobytes. A gigabyte


(GB) is 1,024 megabytes. A terabyte (TB) is 1,024 gigabytes.) {byte was the
number of bits used to encode a single character of text in a computer. The
byte is a unit of digital information that most commonly consists of eight bits.}

A group of 4 bits is called a nibble, and 8-bits makes a byte. Bytes are a pretty
common buzzword

Storage Unit example

A storage contains millions of bytes of memory to store anything we want on our


computer. To store a bit of data in computer memory, we use a circuit, called a
latch, that stores the previous input unless it’s reset. We can create a circuit using
a:

 S-R latch
 Gated S-R latch
 D latch
Memory

There are components to a computer’s hardware memory. Main


memory or random access memory (RAM) is the physical memory space
inside a computer. It stores data and instructions that can directly be accessed by
the CPU. Computers usually have a limited amount of main memory to store all
your data.

That is when secondary storage comes into use. Secondary storage augments the
main memory and holds data and programs that are not needed immediately.

Secondary storage devices include hard drives, compact discs (CD), USB flash
drives, etc. Secondary storage devices cannot be directly accessed by the CPU.

Software components

Now let’s discuss the different software components that we need to have a
functioning computer. Remember: software comprises the set of programs,
procedures, and routines associated needed to operate a computer.

Machine language

A computer can only process binary: a stream of ones and zeros. Binary is the
computer’s language. Instructions for the computer are also stored as ones and
zeros that the computer must decode and execute.

Assembly language

Assembly language is a human-readable instruction mode that translates binary


opcode into assembly instruction. A CPU cannot process or execute assembly
instructions, so an encoder is required that can convert assembly language to
machine language.

Assembler

An assembler translates an assembly language program into machine language

High-level languages

Assembly language is referred to as a low-level language because it’s a lot like


machine language. To overcome these shortcomings, high-level languages were
created.

These are called programming languages, and they allow us to create powerful,
complex, human-readable programs without large numbers of low-level
instructions. Some of the most popular programming languages are

Python, Java, C++

How do you design software?

Software design is the process of transforming particular requirements into a


suitable program using code and a high-level language. We need to properly
design a program and system that meets our goals.

Developers use software design to think through all the parts of their code and
system. Software design includes three levels:

 Architectural Design: an abstract version of the program or system that


outlines how components interact with each other.
 High-level Design: this part breaks the design into sub-systems and
modules. High-level design focuses on how the system should be
implemented.
 Detailed Design: this part deals with the implementation. This is here we
define the logical structure of each module.

 Basic syntax of programming language

Computer programming is one of the most sought-after careers today. In fact,


software engineering is one of the most in demand careers across multiple
industries.

What is programming?
Before we can introduce you to some key concepts, we need to make sure we
understand what programming really is.
A computer is a hardware machine that can store and process information. The
language of a computer is Binary a complex set of ones and zeroes.
Programming is essentially the larger-scale process of developing a complex
machine program that acts according to our wishes.

Programming is the basic communication between human input and machine


output. It is the way that a computer knows how and when to process data.

So, what is coding, then?


Think of coding as a translator between English (or a different human language)
and the computer’s binary. Coding involves the actual syntax and structure by
which we write commands. A computer can then take those commands,
translate it into binary, and do what is written. Coding involves writing
commands in a language that a computer can understand.

What is hardware? What is software?


In order for a computer to work, it requires both hardware and software.
Software is a collection of instructions and programs that are downloaded to a
computer. The apps on an iPad or Microsoft Word are examples of
software. Hardware on the other hand, is the physical device that stores,
delivers, and executes that software. The physical iPad or monitor would be an
example of hardware.

A hardware engineer is responsible for manufacturing and designing devices


that interact with software. They will usually have a background in Electrical
and Computer Engineering. A software engineer, on the other hand, develops
and codes software programs for those devices. They will usually have a
background in Software Engineering or Computer Science.

What is front-end? What is back-end?


Within the world of software development, there are two common camps that
programmers fall into that utilize different tools, skills, and end-goals: front-end
and back-end development.

Front-end development focuses on what the user will actually see on their
screen. This involves the design, application debugging, and coding for user
experience. This job is all about the feel, look, and design of a program or
website.
Back-end development focuses on everything that makes the front-end
possible. This job is all about how a site or application works, how quickly it
functions, and how it communicates with databases (where data is stored).
Many programmers are more generalists on both sides. They are called full
stack developers.
In the following sections, we will discuss the need-to-know concepts to become
a programmer:

 Programming languages
 Coding syntax, vocabulary, and lingo
 Data structures and algorithms

What is a programming language?


A programming language is a formal set of notations and rules. They generate
instructions and implement algorithms based on the predetermined rules of that
language. A computer can then produce an output from that text.
There are tons of programming languages, and they each serve different
purposes, styles, and specializations. Let’s get familiar with the ten most
popular programming languages out there.

1. Java: this is one of the older, more established programming languages.


It is used in universities and large-scale businesses.
2. PYTHON: this is a very user-friendly language preferred by many
beginners. The syntax is simple and clear, so many newbies get started on
Python.
3. JavaScript : this is a text-based language for web development.
JavaScript is foundational to all websites.
4. C: this is one of the original programming languages, so it’s like the
parent language. C is known for being hard to learn, but it works great for
high-performance applications.
5. C++: this language is based on C and adds new features to the old
language. It’s also an older one and is known for having a bit of a
learning curve. Many universities still teach C++.
6. PHP: this is a scripting language that uses HTML to make websites, but
it’s taken off for a lot of other uses.
7. Swift: this language, developed by Apple, is great for iOS and Mac OS
apps. It’s designed similarly to Python and Ruby; it is simple and easy to
learn. There is a general push to get more Swift programmers in the field.
8. Objective-C: this is an older language that is being slowly replaced by
Swift, but it is an important language for the history of software
development. It is especially useful for creating applications on Mac OS
X and iPhone iOS.
Imperative vs. Declarative Paradigms
As we mentioned, programming languages have different styles. In fact, every
programming language operates according to a paradigm. A paradigm is
basically the way that a computer will logically approach a problem. It is the
style of that language.

There are many different paradigms out there, and they all fall under two
branches: imperative and declarative.

For imperative programming, you tell the compiler what you want to happen
to your code. You give it all the steps, and it “listens” to your imperative
commands. You give the instructions, not the desired outcome.
For declarative programming, you will write code that describes what you
want to happen, but you don’t explain how to get that result. You give the
outcome you want, not the instructions to get there.

As a beginner, there are really only two paradigms that you need to know about:
Object-Oriented and Functional.

 Object-Oriented programming is an imperative paradigm that largely


dominates the field. In this paradigm, everything is treated like an object,
a thing you can interact with or alter.
 Functional programming is a declarative paradigm that thinks about
data through sets of tasks, which we call functions.

Compiled vs. Interpreted Languages


A programming language isn’t the only tool necessary for communicating with
a computer. After all, the computer “thinks” in binary. Compilers and
interpreters take human-readable code and translate it to computer-readable
code.

A compiled language means that the machine directly translates the program
that you input.

These tend to be faster and more efficient but require an extra “build” step.
An interpreted language, however, requires another program to read and
execute the code, sort of like a middle-man.

What is syntax?
Syntax of a computer language is the set of rules that defines the structure of
the language. Semantics, on the other hands, refers to logic. Semantics deals
with the meaning assigned to the symbols, characters and words.

So, syntax is structure and form. Semantics is logical meaning.

Keywords
Keywords are reserved words that have pre-determined meanings and uses.
Each programming language has its own set of keywords, though there is a lot
of cross-over.
The keyword def, for example, defines a function (a task), and the
keyword return runs that function and returns the result. Take a look below and
try it out yourself once you understand how it works.

Identifiers
Identifiers are similar to keywords, but these are the names that the
programmer would create to label different entities in their program.
We use these to differentiate one entity from another. To create an
identifier, you must follow the syntactic rules as outlined by the
programming language of your choice. Keywords cannot be used as
identifiers

 Identifiers cannot include any special characters like! @, &, $, %, etc.


 They cannot begin with a digit

Variables
Variables allow you to store information that can be accessed over and over
again. These are similar to variables in algebra. But in programming, we
name our variables according to the syntax of that language. Naming a
variable is called declaring a variable.
These are useful for any data or value that you want to use more than once.

Data Types
Data types are like classifications that tell the compiler or interpreter how to
use a piece of information..

1. Integers are numbers without decimals, just like in algebra. In fact, they
can be used to do algebra in your programs. Integers can be stored in
variables so we can use them over and over again.

2. Lists allow us to store multiple variables in one group. This way, we can
perform actions and functions to an entire list of data.

3. Boolean is basically a yes or no response. They


will return either True or False. These can serve tons of different
purposes, like comparing the equality of two numbers or variables.
4. Strings are commonly pieces of text in programming languages, such as
our Hello World! statement They are written with quotation
[Link]

Operators are symbols that perform mathematical functions to your data. There
are different categories of operators. The most important operators for you at
this stage are the following:

Arithmetic (for simple arithmetic)


Assignment (to assign value)

Relational (for comparison, returning boolean values)

Logical (to return boolean from a boolean input)

a + b = 30

c=a+b

40 > 30
abc == abc

(2 < 3) and (2 < 5)

Conditionals
Conditionals allow us to perform certain actions depending on a condition. (IF)

Functions
Functions are like actions or commands.

Loops
With a loop, you can run the same block of code over and over again,

Data structures and algorithms


Data structures and algorithms are a key part of programming.

Data Structures
The way we organize that data makes it easier to use and access
information. Data structures are the way that we arrange data in a computer’s
memory.

Data structures use logic to organize information according to two


concerns: firstly, how should we store data, and secondly, what actions will
we perform on that data?
Broadly speaking, data structures fall into two categories: linear and
hierarchical structures.

 Linear structures organize data in a linked fashion, where each element


is attached to the one before and after it.
 Hierarchical structures organize data like a multi-level pyramid or tree.
As you can imagine, these data structures have very different uses.

Algorithms

Think of algorithms as a step-by-step process to solve a problem. They are


sets of rules that are followed by your program to complete certain
operations or calculations. Think of this as a recipe.
An algorithm outlines a set of rules (the recipe) to get an expected output (the
dish). Inputs are fed into the algorithm, and it implements various
functions (tasks) to obtain that expected output. You can either use pre-
existing algorithms or write your own.
Algorithms and data structures work together to serve different purposes for
your programs. For example, since algorithms can be used to search or sort data,
the way you organize your data will impact how quickly your algorithm can
work.

Bug

A bug generally describes an unexpected error or mistake in your software


or hardware. These can be malfunctions, defects, glitches, and the like. Bugs
can cause an entire computer system to crash if they aren’t addressed
properly. A lot of programming involves testing for and solving bugs. That
process is called debugging.

Text editor
Text editors are where you write your code. They are like notepads on your
computer where you can type a program and create files. There are many
different types of text editors, as some are better for certain languages.

IDE
An (integrated development environment) is a more robust text editor that
includes many other features on top of a text editor “notepad”. These
applications include a compiler, runtime environment, and debugger, so they are
far larger than a text editor.

Source code
Source code is your program’s code. It is the human-readable instructions that
you write as a programmer. This is the data that is then compiled and turned
into binary machine code.

Open-source
The world of programming is filled with OPEN SOURCE content. This is basically
software with a license stating that the source code can be used, modified, or
changed by any coder. Open-source content and code are freely available and
can be freely distributed.

Refactoring

Refactoring is the process of changing a software system in a way that


doesn’t change the actual behaviour or output of the code. This is done to
improve or optimize internal structure, for example, by simplifying certain
blocks of code or adding a feature.

Runtime

Runtime, as the name implies, is the amount of time it takes a program to


run on a computer. It is when the computer is executing the machine code. If
something occurs “at runtime” (a phrase you will likely hear), it occurs as soon
as the program begins. This is often where bugs will be discovered or
abnormalities will become apparent.

Libraries
Libraries are open-source collections of prewritten code that a
programmer can add to their program for certain functionalities. Different
languages have different libraries, and these are sometimes huge factors for
choosing certain languages for a project.

You might also like