0% found this document useful (0 votes)
12 views26 pages

Intro To It (Extra Materials)

A Database Management System (DBMS) is software that manages and organizes data in a structured manner, allowing users to create, modify, and query databases efficiently. It includes features such as data modeling, storage and retrieval, concurrency control, data integrity, security, and backup and recovery, with types including RDBMS and NoSQL. E-commerce, the buying and selling of goods and services online, has transformed business operations by providing convenience, global reach, and automation, with various models such as B2C, B2B, and C2C.

Uploaded by

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

Intro To It (Extra Materials)

A Database Management System (DBMS) is software that manages and organizes data in a structured manner, allowing users to create, modify, and query databases efficiently. It includes features such as data modeling, storage and retrieval, concurrency control, data integrity, security, and backup and recovery, with types including RDBMS and NoSQL. E-commerce, the buying and selling of goods and services online, has transformed business operations by providing convenience, global reach, and automation, with various models such as B2C, B2B, and C2C.

Uploaded by

edward kariuki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 26

DATABASE

A database is a collection of interrelated data that helps in the efficient retrieval,


insertion, and deletion of data from the database and organizes the data in the form of
tables, views, schemas, reports, etc. For Example, a university database organizes the data
about students, faculty, admin staff, etc. which helps in the efficient retrieval, insertion,
and deletion of data from it.

What is DBMS?
A Database Management System (DBMS) is a software system that is designed to manage
and organize data in a structured manner. It allows users to create, modify, and query a
database, as well as manage the security and access controls for that database. DBMS
provides an environment to store and retrieve data in convenient and efficient manner.

Key Features of DBMS


 Data modeling: A DBMS provides tools for creating and modifying data models, which
define the structure and relationships of the data in a database.
 Data storage and retrieval: A DBMS is responsible for storing and retrieving data from
the database, and can provide various methods for searching and querying the data.
 Concurrency control: A DBMS provides mechanisms for controlling concurrent access
to the database, to ensure that multiple users can access the data without conflicting
with each other.
 Data integrity and security: A DBMS provides tools for enforcing data integrity and
security constraints, such as constraints on the values of data and access controls that
restrict who can access the data.
 Backup and recovery: A DBMS provides mechanisms for backing up and recovering the
data in the event of a system failure.
 DBMS can be classified into two types: Relational Database Management System
(RDBMS) and Non-Relational Database Management System (NoSQL or Non-SQL)
 RDBMS: Data is organized in the form of tables and each table has a set of rows and
columns. The data are related to each other through primary and foreign keys.
 NoSQL: Data is organized in the form of key-value pairs, documents, graphs, or
column-based. These are designed to handle large-scale, high-performance scenarios.

Types of DBMS
1. Relational Database Management System (RDBMS): Data is organized into tables
(relations) with rows and columns, and the relationships between the data are
managed through primary and foreign keys. SQL (Structured Query Language) is used
to query and manipulate the data.
2. NoSQL DBMS: Designed for high-performance scenarios and large-scale data, NoSQL
databases store data in various non-relational formats such as key-value pairs,
documents, graphs, or columns.
3. Object-Oriented DBMS (OODBMS): Stores data as objects, similar to those used in
object-oriented programming, allowing for complex data representations and
relationships
Database Languages
 Data Definition Language
 Data Manipulation Language
 Data Control Language
 Transactional Control Language
Data Definition Language (DDL)

DDL is the short name for Data Definition Language, which deals with database schemas
and descriptions, of how the data should reside in the database.
 CREATE: to create a database and its objects like (table, index, views, store procedure,
function, and triggers)
 ALTER: alters the structure of the existing database
 DROP: delete objects from the database
 TRUNCATE: remove all records from a table, including all spaces allocated for the
records are removed
 COMMENT: add comments to the data dictionary
 RENAME: rename an object

Data Manipulation Language (DML)

DML is the short name for Data Manipulation Language which deals with data
manipulation and includes most common SQL statements such SELECT, INSERT, UPDATE,
DELETE, etc., and it is used to store, modify, retrieve, delete and update data in a
database. Data query language(DQL) is the subset of “Data Manipulation Language”. The
most common command of DQL is SELECT statement. SELECT statement help on retrieving
the data from the table without changing anything in the table.
 SELECT: retrieve data from a database
 INSERT: insert data into a table
 UPDATE: updates existing data within a table
 DELETE: Delete all records from a database table
 MERGE: UPSERT operation (insert or update)
 CALL: call a PL/SQL or Java subprogram
 EXPLAIN PLAN: interpretation of the data access path
 LOCK TABLE: concurrency Control

Data Control Language (DCL)

DCL is short for Data Control Language which acts as an access specifier to the database.
(basically to grant and revoke permissions to users in the database
 GRANT: grant permissions to the user for running DML(SELECT, INSERT, DELETE,…)
commands on the table
 REVOKE: revoke permissions to the user for running DML(SELECT, INSERT, DELETE,…)
command on the specified table

Transactional Control Language (TCL)

TCL is short for Transactional Control Language which acts as an manager for all types of
transactional data and all transactions. Some of the command of TCL are
 Roll Back: Used to cancel or Undo changes made in the database
 Commit: It is used to apply or save changes in the database
 Save Point: It is used to save the data on the temporary basis in the database

Data Query Language (DQL)

Data query language(DQL) is the subset of “Data Manipulation Language”. The most
common command of DQL is 1the SELECT statement. SELECT statement helps us in
retrieving the data from the table without changing anything or modifying the table. DQL
is very important for retrieval of essential data from a database.
Paradigm Shift from File System to DBMS
File System manages data using files on a hard disk. Users are allowed to create, delete,
and update the files according to their requirements. Let us consider the example of file-
based University Management System. Data of students is available to their respective
Departments, Academics Section, Result Section, Accounts Section, Hostel Office, etc.
Some of the data is common for all sections like Roll No, Name, Father Name, Address,
and Phone number of students but some data is available to a particular section only like
Hostel allotment number which is a part of the hostel office. Let us discuss the issues with
this system:
 Redundancy of data: Data is said to be redundant if the same data is copied at many
places. If a student wants to change their Phone number, he or she has to get it
updated in various sections. Similarly, old records must be deleted from all sections
representing that student.
 Inconsistency of Data: Data is said to be inconsistent if multiple copies of the same
data do not match each other. If the Phone number is different in Accounts Section
and Academics Section, it will be inconsistent. Inconsistency may be because of typing
errors or not updating all copies of the same data.
 Difficult Data Access: A user should know the exact location of the file to access data,
so the process is very cumbersome and tedious. If the user wants to search the
student hostel allotment number of a student from 10000 unsorted students’ records,
how difficult it can be.
 Unauthorized Access: File Systems may lead to unauthorized access to data. If a
student gets access to a file having his marks, he can change it in an unauthorized way.
 No Concurrent Access: The access of the same data by multiple users at the same time
is known as concurrency. The file system does not allow concurrency as data can be
accessed by only one user at a time.
 No Backup and Recovery: The file system does not incorporate any backup and
recovery of data if a file is lost or corrupted.

Advantages of DBMS
 Data organization: A DBMS allows for the organization and storage of data in a
structured manner, making it easy to retrieve and query the data as needed.
 Data integrity: A DBMS provides mechanisms for enforcing data integrity constraints,
such as constraints on the values of data and access controls that restrict who can
access the data.
 Concurrent access: A DBMS provides mechanisms for controlling concurrent access to
the database, to ensure that multiple users can access the data without conflicting
with each other.
 Data security: A DBMS provides tools for managing the security of the data, such as
controlling access to the data and encrypting sensitive data.
 Backup and recovery: A DBMS provides mechanisms for backing up and recovering the
data in the event of a system failure.
 Data sharing: A DBMS allows multiple users to access and share the same data, which
can be useful in a collaborative work environment.

Disadvantages of DBMS
 Complexity: DBMS can be complex to set up and maintain, requiring specialized
knowledge and skills.
 Performance overhead: The use of a DBMS can add overhead to the performance of
an application, especially in cases where high levels of concurrency are required.
 Scalability: The use of a DBMS can limit the scalability of an application, since it
requires the use of locking and other synchronization mechanisms to ensure data
consistency.
 Cost: The cost of purchasing, maintaining and upgrading a DBMS can be high,
especially for large or complex systems.
 Limited Use Cases: Not all use cases are suitable for a DBMS, some solutions don’t
need high reliability, consistency or security and may be better served by other types
of data storage.

Applications of DBMS
 Enterprise Information: Sales, accounting, human resources, Manufacturing, online
retailers.
 Banking and Finance Sector: Banks maintaining the customer details, accounts, loans,
banking transactions, credit card transactions. Finance: Storing the information about
sales and holdings, purchasing of financial stocks and bonds.
 University: Maintaining the information about student course enrolled information,
student grades, staff roles.
 Airlines: Reservations and schedules.
 Telecommunications: Prepaid, postpaid bills maintains.

Conclusion
A Database Management System (DBMS) is an essential tool for efficiently managing,
organizing, and retrieving large volumes of data across various industries. Its ability to
handle data securely, ensure integrity, support concurrent access, and provide backup and
recovery options makes it indispensable for modern data-driven applications. While
DBMSs come with complexities and costs, their benefits in terms of data management and
security far outweigh the challenges, making them a crucial component in any data-centric
environment
E-commerce
Introduction:
E-commerce, or electronic commerce, refers to the buying and selling of goods and services
over the internet. It involves the use of electronic platforms, such as websites, mobile
applications, and social media, to conduct transactions between businesses and consumers
or between businesses. E-commerce has revolutionized the way businesses operate and has
created new opportunities for entrepreneurs and consumers alike.
One of the primary benefits of e-commerce is that it offers a more convenient and efficient
way to conduct business. Consumers can browse and purchase products from the comfort
of their own homes, while businesses can reach a global audience without the need for a
physical storefront. E-commerce has also enabled businesses to streamline their operations
by automating many of the tasks involved in the sales process, such as inventory
management, order processing, and shipping.
E-commerce has continued to grow in popularity and importance, particularly in light of the
COVID-19 pandemic, which has led to a surge in online shopping as people seek to minimize
in-person interactions. As a result, businesses that are able to adapt to the e-commerce
landscape are likely to have a competitive advantage in the years to come.
E-commerce is also known as Electronic Commerce, refers to buying and selling of products
or services over the Internet. Normally e-commerce is used to refer to the sale of physical
products online, but it can also describe any kind of commercial transaction that is
facilitated through the internet. The first-ever online sale was in 1994 when a man sold a CD
by the band Sting to his friend through his website Net Market, an American retail platform.
This is the first example of a consumer buying a product from a business through the World
Wide Web or e-commerce as we commonly know it today. After that e-commerce has
evolved to make products easier to discover and purchase through online retailers and
marketplaces. All freelancers, as well as small and large businesses, have benefited from e-
commerce which enables them to sell their goods and services at a scale that was not
possible with traditional offline retail.

Types of E-commerce model:


There are types of e-commerce models that can describe almost every transaction that
takes place between consumers and businesses.
1. Business to Consumer (B2C): When a good or service is sold to an individual consumer
by a business, e.g., we buy a pair of shoes from an online retailer.
2. Business to Business (B2B): When a good or service is sold by a business to another
business, e.g., a software-as-a-service is sold by a business for other businesses to use.
3. Consumer to Consumer (C2C): When a good or service is sold by a consumer to another
consumer, e.g., we sell our old furniture on eBay to another consumer.
4. Consumer to Business (C2B): When a consumer’s own products or services is sold to a
business or organization, e.g., an authority offers exposure to their online audience in
exchange for a fee or a photographer licenses their photo for a business to use.
5. Business-to-government (B2G): In this model, businesses sell products or services to
government agencies through online portals or marketplaces.
6. Government-to-business (G2B): In this model, government agencies sell products or
services to businesses through online portals or marketplaces.
7. Government-to-consumer (G2C): In this model, government agencies provide products
or services directly to consumers through online portals or marketplaces.
Business Application of E-commerce:
 Conversational commerce: e-commerce via chat
 Digital Wallet
 Document automation in supply chain and logistics
 Electronic tickets
 Enterprise content management
 Group buying
 Instant messaging
 Newsgroups
 Online banking
 Online office suites
 Online shopping and order tracking
 Pretail
 Print on demand
 Shopping cart software
 Social networking
 Teleconferencing
 Virtual assistant (artificial intelligence)
 Domestic and international payment systems

Features:

Product catalog: An e-commerce platform should provide an easy way to create and
manage a product catalog, including adding new products, editing existing ones, and
categorizing them.
Shopping cart: A shopping cart is a tool that allows customers to add products they want to
purchase and keep track of the items as they continue to browse the website.
Checkout and payment processing: A reliable checkout and payment processing system is
essential for e-commerce success. Customers should be able to complete transactions
quickly and easily using a variety of payment methods.
Shipping and order management: Once a customer places an order, the e-commerce
platform should provide tools to manage the order, including tracking information, shipping
options, and delivery status.
Customer accounts and loyalty programs: Many e-commerce platforms allow customers to
create accounts, which can help businesses build relationships and loyalty. Additionally,
loyalty programs can incentivize repeat purchases and encourage customers to refer others.
Marketing and analytics: An e-commerce platform should offer tools to help businesses
market their products, such as email campaigns and social media integration. Additionally,
analytics can help businesses track customer behavior, identify trends, and improve their
overall strategy.
Mobile optimization: With more people shopping on their mobile devices, it’s essential that
e-commerce platforms are mobile-optimized, with a responsive design that provides an
optimal shopping experience on smartphones and tablets.
Advantages of E-commerce:
 E-commerce enables fast and secure shopping.
 It is making digitalized world.
 E-commerce also enables to choose different goods and services according to your
choice.
 It is a simple way of selling and buying products and services.
 E-commerce replaced the paper work as all transactions are through internet today.
 It provides better management system, as it has a centralized database.
 E-commerce via internet covers a large number of customers worldwide.
 E-commerce has several payment modes.
Disadvantages of E-commerce:
 E-commerce has no universal standard for quality and reliability.
 E-commerce works through internet, it is possible that navigation on internet itself may
be slow.
 Strong security is required in e-commerce as all transactions are through internet.
 There is high risk of buying unsatisfactory products through e-commerce.
 It uses public key infrastructure which is not safe.
 Customers also trap in banking fraud which is quite frequent.
 Hackers also try to get access of data or to destroy data in e-commerce.
Uses of E-commerce :
1. Online retail: One of the most well-known uses of e-commerce is online retail, where
businesses sell products directly to consumers through their online store, website, or
mobile app.
2. Digital products and services: E-commerce is also commonly used for the sale of digital
products and services, such as music, e-books, software, and online courses.
3. Business-to-business transactions: E-commerce can be used for B2B transactions, where
businesses sell products or services to other businesses.
4. Online marketplaces: E-commerce marketplaces, such as Amazon and eBay, provide a
platform for businesses and individuals to sell their products to a large audience.
5. Auction sites: Online auction sites, such as eBay, allow users to bid on and purchase
items from other users.
6. Online banking and financial services: E-commerce is used extensively for online
banking and financial services, including payment processing, bill payment, and money
transfers.
7. Online booking and reservations: E-commerce is used for booking and reservations of
flights, hotels, rental cars, and other travel-related services.
8. Food delivery: E-commerce platforms are used for online ordering and delivery of food
from restaurants.
9. Online advertising: E-commerce is also used for online advertising, where businesses
can advertise their products and services to a large audience.
There are many benefits of e-commerce for both businesses and consumers. Some of the
key benefits of e-commerce are:
1. Convenience: E-commerce allows customers to shop from the comfort of their own
homes or wherever they have internet access, making it convenient for them to make
purchases at any time.
2. Global Reach: E-commerce enables businesses to reach a wider audience beyond their
physical locations, allowing them to expand their customer base globally.
3. Cost-Effective: E-commerce eliminates the need for physical storefronts and reduces
overhead costs associated with operating a traditional brick-and-mortar store.
4. Personalization: E-commerce allows businesses to personalize their offerings based on
customer behavior and preferences, offering a more personalized shopping experience.
5. Easy and Secure Payment: E-commerce provides secure and convenient payment
options, making it easy for customers to make purchases.
6. Data Collection and Analysis: E-commerce provides businesses with the ability to collect
and analyze customer data, enabling them to improve their marketing and sales
strategies.
7. 24/7 Availability: E-commerce websites are always available for customers to access,
allowing them to make purchases at any time, even outside of business hours.
8. Overall, e-commerce provides businesses with new opportunities to expand their
customer base, increase sales, and improve customer satisfaction, while also offering
customers greater convenience, access, and flexibility.
Computer Virus
A computer virus is a type of malicious software program (“malware“) that, when executed,
replicates itself by modifying other computer programs and inserting its code. When
this replication succeeds, the affected areas are then said to be “infected“. Viruses can
spread to other computers and files when the software or documents they are attached to
are transferred from one computer to another using a network, a disk, file-sharing
methods, or through infected email attachments.
What is a Computer Virus?
A computer virus is a type of harmful program. When it runs, it makes copies of itself and
adds its code to other programs and files on your computer. These viruses come in different
types, and each type can affect your device differently. Simply put, a computer virus
changes how your computer works and aims to spread to other computers. It does this by
attaching itself to normal programs or documents that can run code, known as macros.
What Does a Computer Virus Do?
A virus can harm or destroy data, slow down system resources, and log keystrokes, among
other things. A virus can have unexpected or harmful outcomes during this procedure, such
as destroying system software by corrupting data. Some viruses are made to mess things up
by deleting files, messing up programs, or even wiping out your hard drive completely.
Even if they’re not super harmful, viruses can still slow down your computer a lot, using up
memory and making it crash often. Others might just make copies of themselves or send
so much stuff over the internet that it’s hard to do anything online.
Virus vs. Malware – What is the difference?
Viruses and malware are often used interchangeably, but they’re not quite the same. Here’s
how they differ:

Aspect Virus Malware

Definitio A type of malicious


A broader category of harmful software
n software

Behavior Self-replicating Can include viruses, worms, trojans, etc.


Aspect Virus Malware

Can spread through various methods,


Often requires user
Spread including email, downloads,
interaction
and vulnerabilities

Can cause a range of harm, including data


Damage Can corrupt or delete files
theft, system damage, and spying

Can be detected by Requires comprehensive security measures


Detection
antivirus software and practices

Examples Morris Worm, ILOVEYOU WannaCry ransomware, Zeus trojan

History of Computer Virus


Viruses have been attacking various devices for a long time, spreading through
the Internet or other means. They are often created to steal information or completely ruin
devices. The first computer virus, called the “Creeper system,” appeared in 1971 as an
experimental virus that could copy itself. Following that, in the mid-1970s, the
“Rabbit” virus emerged, which replicated very quickly and caused significant damage at the
same pace. The virus known as “Elk Cloner” was created in 1982 by Rich Skrenta. It spread
through a floppy disk containing a game and attached itself to the Apple II operating
system.
The first virus for MS-DOS, called “Brain,” appeared in 1986. It was designed by two
Pakistani brothers and overwrote the boot sector of floppy disks, making it impossible for
the computer to start. It was originally meant to be a copy protection system. In 1988,
more destructive viruses began to surface. Until then, most viruses were considered pranks
with funny names and messages. However, in 1988, “The Morris” became the first widely
spreading virus.
How To Prevent Your Computer From Viruses?
Keeping your computer safe from viruses is a lot like keeping yourself from catching a cold.
Just as you might wash your hands regularly or avoid sick friends, there are simple steps you
can take to protect your computer. Here are some easy tips:
1. Install Antivirus Software: Think of antivirus software as your computer’s doctor. It works
around the clock to detect and block viruses before they can infect your system. Make sure
to keep it updated!
2. Update Regularly: Keep your operating system, software, and apps up to date. Updates
often include fixes for security vulnerabilities that viruses could exploit.
3. Be Cautious with Emails and Downloads: Don’t open emails or download attachments
from unknown sources. If an email looks suspicious, even if you know the sender, it’s best
to delete it.
4. Use Strong Passwords: Protect your accounts with strong, unique passwords. Consider
using a password manager to keep track of them all.
5. Backup Your Data: Regularly back up your data to an external drive or cloud storage. If
a virus does slip through, you won’t lose everything.
By following these steps, you can help keep your computer virus-free and running smoothly.
How to Remove Computer Viruses?
To remove a computer infection, you can choose from two options:
Do-it-yourself manual approach: This means you try to fix the problem on your own.
Usually, you start by searching online for solutions. Then, you might have to do a lot of tasks
to clean up your computer. It can take time and might need some experience to finish
everything.
Get help from a reliable antivirus product: Another option is to use antivirus software. This
software is designed to find and remove viruses from your computer. You just need to install
it and let it do its job.
What is Antivirus?
Antivirus software is a program that searches for, detects, prevents, and removes software
infections that can harm your computer. Antivirus can also detect and remove other
dangerous software such as worms, adware, and other dangers. This software is intended
to be used as a preventative measure against cyber dangers, keeping them from entering
your computer and causing problems. Antivirus is available for free as well. Anti-virus
software that is available for free only provides limited virus protection, whereas premium
anti-virus software offers more effective security. For example Avast, Kaspersky, etc.
Different Types of Computer Virus
Each type has a unique way of infecting and damaging computers. Here are a few examples:
Type of Virus Description

Attacks the part of the computer that starts up when you turn it on.
Boot Sector
Boot Sector Virus can also spread through devices like floppy disks.
Virus
Often called a memory virus.

Attaches to the end of a file and modifies how a program starts to run
File Virus
the virus’s code first.

Hides in email messages and activates by clicking a link, opening an


Email Virus
attachment, or interacting with the email.

Polymorphic Changes its form every time it installs to avoid detection by antivirus
Virus software.

Activates by running a program capable of executing macros, often


Macro Virus
found in documents like spreadsheets.

Multipartite Infects the computer’s boot sector, memory, and files, making it
Virus difficult to detect and remove.

Encrypted Uses encryption to hide from antivirus software, includes


Virus a decryption algorithm to run before executing.

Stealth Virus Modifies detection code, making it very difficult to detect.

Saves itself in the computer’s memory and can infect other files even
Resident Virus
after the original program stops.

Direct Action Tied to an executable file, it activates when the file is opened but does
Virus not delete files or affect system speed; blocks file access.
Type of Virus Description

Browser Changes browser settings without permission, can redirect to


Hijacker Virus malicious sites.

How do computer viruses spread?


Through the following activities you may get your device infected by the virus :
1. Sharing the data like music, files, and images with each other.
2. If you open a spam email or an attachment in an email that is sent by an unknown
person.
3. Downloading the free games, toolbars, media players, etc.
4. Visiting a malicious website.
5. Installing pirated software(s) etc.
Examples of Computer Viruses
A computer virus is a type of software designed to spread from one computer to another,
similar to how a cold spreads between people. Just like a cold virus can make us sick, a
computer virus can harm a computer’s performance and security. Here are some common
examples of computer viruses:

Virus Name Description

One of the first and most widespread computer viruses, the Morris
Morris
Worm was a self-replicating program that spread across the
Worm
early Internet in 1988, causing delays and crashes on many devices.

Appearing in 2001, Nimda targeted web servers and computers


Nimda running Microsoft Windows. It spread through various
methods, infecting quickly and widely.

In 2000, the ILOVEYOU worm spread through emails disguised as love


ILOVEYOU
confessions. It overwrote data and caused extensive damage.

SQL This fast-spreading computer worm emerged in 2003, exploiting a


Virus Name Description

vulnerability in Microsoft SQL Server. It caused significant network


Slammer
congestion and disrupted Internet services.

Developed in 2010, Stuxnet was a sophisticated worm aimed at


Stuxnet damaging industrial control systems, particularly Iran’s nuclear facilities.
It exploited zero-day vulnerabilities.

CryptoLocker, a ransomware Trojan from 2013, infected hundreds


CryptoLocker of thousands of computers, encrypted victims’ files, and demanded a
ransom to unlock them.

First detected in 2008, Conficker exploited weaknesses in Windows


Conficker operating systems, creating a large botnet and causing widespread
infections.

Discovered in 2012, Tinba is a banking Trojan that primarily targets


Tinba
financial institutions to steal login credentials and banking information.

Since 2018, Shlayer has been a macOS-specific


Shlayer Trojan spreading adware and unwanted programs through fake
software updates and downloads.

Conclusion
In conclusion, understanding what a computer virus is and recognizing the dangers it poses
is crucial for keeping your data safe. These viruses are designed to infect, replicate,
and damage the functioning of computers. Protecting your computer with antivirus
software, being cautious with email attachments, and avoiding suspicious websites are
essential steps to prevent virus infections. By staying informed and attentive, you can help
safeguard your computer from the potential destruction caused by computer viruses.

Numeral System

Numeral System
b - Numeral system base
dn - the n-th digit
n – Can start from negative number if the number has a fraction part.
N+1 - the number of digits
Binary Numeral System - Base-2
Binary numbers uses only 0 and 1 digits.
B denotes binary prefix.
Examples:
101012 = 10101B = 1×24+0×23+1×22+0×21+1×20 = 16+4+1= 21
101112 = 10111B = 1×24+0×23+1×22+1×21+1×20 = 16+4+2+1= 23
1000112 = 100011B = 1×25+0×24+0×23+0×22+1×21+1×20 =32+2+1= 35
Octal Numeral System - Base-8
Octal numbers uses digits from 0..7.
Examples:
278 = 2×81+7×80 = 16+7 = 23
308 = 3×81+0×80 = 24
43078 = 4×83+3×82+0×81+7×80= 2247
Decimal Numeral System - Base-10
Decimal numbers uses digits from 0..9.
These are the regular numbers that we use.
Example:
253810 = 2×103+5×102+3×101+8×100
Hexadecimal Numeral System - Base-16
Hex numbers uses digits from 0..9 and A..F.
H denotes hex prefix.
Examples:
2816 = 28H = 2×161+8×160 = 40
2F16 = 2FH = 2×161+15×160 = 47
BC1216 = BC12H = 11×163+12×162+1×161+2×160= 48146
Numeral systems conversion table
Decimal Binary Octal Hexadecimal
Base-10 Base-2 Base-8 Base-16

0 0 0 0

1 1 1 1
2 10 2 2

3 11 3 3

4 100 4 4

5 101 5 5

6 110 6 6

7 111 7 7

8 1000 10 8

9 1001 11 9

10 1010 12 A

11 1011 13 B

12 1100 14 C

13 1101 15 D

14 1110 16 E

15 1111 17 F

16 10000 20 10

17 10001 21 11

18 10010 22 12

19 10011 23 13

20 10100 24 14

21 10101 25 15

22 10110 26 16
23 10111 27 17

24 11000 30 18

25 11001 31 19

26 11010 32 1A

27 11011 33 1B

28 11100 34 1C

29 11101 35 1D

30 11110 36 1E

31 11111 37 1F

32 100000 40 20

1. Decimal to Binary

Decimal to binary calculation steps


Divide by the base 2 to get the digits from the remainders:
Division Remainder
by 2 Quotient (Digit) Bit #

(12)/2 6 0 0

(6)/2 3 0 1

(3)/2 1 1 2

(1)/2 0 1 3

= (1100)2
How to convert decimal to binary

Conversion steps:
1. Divide the number by 2.
2. Get the integer quotient for the next iteration.
3. Get the remainder for the binary digit.
4. Repeat the steps until the quotient is equal to 0.

Example #1
Convert 1310 to binary:
Division Quotien
Remainder Bit #
by 2 t

13/2 6 1 0

6/2 3 0 1

3/2 1 1 2

1/2 0 1 3

So 1310 = 11012
Example #2
Convert 17410 to binary:
Division Quotien
Remainder Bit #
by 2 t

174/2 87 0 0

87/2 43 1 1

43/2 21 1 2

21/2 10 1 3

10/2 5 0 4

5/2 2 1 5

2/2 1 0 6

1/2 0 1 7

So 17410 = 101011102
Decimal to binary conversion table
Decimal
Binary Hex
Numbe
Number Number
r

0 0 0
Decimal
Binary Hex
Numbe
Number Number
r

1 1 1

2 10 2

3 11 3

4 100 4

5 101 5

6 110 6

7 111 7

8 1000 8

9 1001 9

10 1010 A

11 1011 B

12 1100 C

13 1101 D

14 1110 E

15 1111 F

16 10000 10

17 10001 11

18 10010 12

19 10011 13

20 10100 14

21 10101 15

22 10110 16
Decimal
Binary Hex
Numbe
Number Number
r

23 10111 17

24 11000 18

25 11001 19

26 11010 1A

27 11011 1B

28 11100 1C

29 11101 1D

30 11110 1E

31 11111 1F

32 100000 20

64 1000000 40

128 10000000 80

256 100000000 100

How to convert binary to decimal

For binary number with n digits:


dn-1 ... d3 d2 d1 d0
The decimal number is equal to the sum of binary digits (dn) times their power of 2 (2n):
decimal = d0×20 + d1×21 + d2×22 + ...
Example
Find the decimal value of 1110012:
binary number: 1 1 1 0 0 1

power of 2: 25 24 23 22 21 20

1110012 = 1⋅25+1⋅24+1⋅23+0⋅22+0⋅21+1⋅20 = 5710


Binary to decimal conversion table

Binary Decimal Hex


Number Number Number

0 0 0

1 1 1

10 2 2

11 3 3

100 4 4

101 5 5

110 6 6

111 7 7

1000 8 8

1001 9 9

1010 10 A

1011 11 B

1100 12 C

1101 13 D

1110 14 E

1111 15 F

10000 16 10

10001 17 11

10010 18 12

10011 19 13

10100 20 14
Binary Decimal Hex
Number Number Number

10101 21 15

10110 22 16

10111 23 17

11000 24 18

11001 25 19

11010 26 1A

11011 27 1B

11100 28 1C

11101 29 1D

11110 30 1E

11111 31 1F

100000 32 20

1000000 64 40

10000000 128 80

100000000 256 100

How to convert binary to hex

Convert every 4 binary digits (from bit0) to hex digit (see conversion table below):

1100

= 1100

=C

=C
Convert every 4 binary digits (start from bit 0) to 1 hex digit, with this table:
Binary Hex
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F
Example
Convert binary 11011002 to hex:
Convert every 4 binary bits (from bit0) to hex digit:
11011002 = 110 1100 = 6 C = 6C16

How to convert hex to binary

Convert every hex digit (start lowest digit) to 4 binary digits, with this table:
Hex Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
Example
Convert hex 6C16 to binary:
6C16 = 6 C = 110 1100 = 11011002

You might also like