SlideShare a Scribd company logo
Instructor: Mark John Lado
In the connection of C programming and
flowcharting, in this topic you will learn on
how to use algorithms.
Stay focus and study hard!
You will be able to
1. define pseudo code
2. write pseudo code on a specific problem
3. know the importance of algorithms
Objectives
Pseudo code is an informal high-level description
of the operating principle of a computer program
or other algorithm. It uses the structural
conventions of a normal programming language,
but is intended for human reading rather than
machine reading.
Pseudo code
#include <stdio.h>
main()
{
printf("Hello Worldn");
getch();
}
C / C++ Code and Pseudo Code
Start
Header files
Opening bracket
display HelloWorld
Get the character
Closing bracket
End
#include <stdio.h>
main()
{
int x = 1;
if (x == 1)
printf("x is equal to one.");
else
printf(“x is not equal to one");
getch();
}
Write the pseudo code
Start
Header files
Opening bracket
Declaring x as integer and is equal to one
if x is equal to one then
print the statement x is equal to one
else
print the statement x is not equal to one
Get the character
Closing bracket
End
Pseudo code of the given previous code
You already had a fundamentals of writing an
algorithms. What’s next?
In the next topic you will be introduced on
how computers store data.
Stay in focus!
Heads up!
Binary Number System
1010001110
You will be able to
1. determine the function of 1 and 0
2. recognize different types of number
systems as they relate to computers.
3. add and subtract in binary
4. convert values from decimal, binary
Objectives
Concept:
All data that is stored in a computer is converted to
sequences of Zero’s and One’s.
Binary Number Systems
A computer’s memory is divided into tiny
storage locations known as bytes. One
byte is only enough memory to store a
letter of the alphabet or a small number.
Binary Number Systems
In order to do anything meaningful, a
computer has to have lots of bytes. Most
computers today have millions, or even
billions, of bytes of memory.
Binary Number Systems
Each byte is divided into eight smaller
storage locations known as bits. The term
bits stands for binary digit. Computer
scientists usually think of bits as tiny
switches that can be either on or off.
Binary Number Systems
Bits aren’t actual “switches,” however, at
least not in the conventional sense. In
most computer systems, bits are tiny
electrical components that can hold
either a positive or a negative charge.
Binary Number Systems
Computer scientists think of a positive
charge as a switch in the on position, and
a negative charge as a switch in the off
position.
Binary Number Systems
Binary Number Systems
Figure shows the way that a computer
scientist might think of a byte of memory:
as a collection of switches that are each
flipped to either the on or off position.
Binary Number Systems
When a piece of data is stored in a byte,
the computer sets the eight bits to an
on/off pattern that represents the data.
Binary Number Systems
A bit can be used in a very limited way to
represent numbers. Depending on
whether the bit is turned on or off, it can
represent one of two different values.
Storing Numbers
In computer systems, a bit that is turned
off represents the number 0 and a bit that
is turned on represents the number 1. This
corresponds perfectly to the binary
numbering system.
Storing Numbers
In the binary numbering system (or binary,
as it is usually called) all numeric values
are written as sequences of 0s and 1s.
Storing Numbers
Here is an example of a number that is
written in binary:
10011101
Storing Numbers
The position of each digit in a binary
number has a value assigned to it. Starting
with the rightmost digit and moving left,
the position values are 2^0 , 2^1 , 2^2 ,
2^3 , and so forth.
Storing Numbers
Storing Numbers
Next figure shows the same diagram with
the position values calculated. Starting
with the rightmost digit and moving left,
the position values are 1, 2, 4, 8, and so
forth.
Storing Numbers
Storing Numbers
To determine the value of a binary number
you simply add up the position values of
all the 1s. For example, in the binary
number 10011101, the position values of
the 1s are 1, 4, 8, 16, and 128.
Storing Numbers
The sum of all of these position values is
157. So, the value of the binary number
10011101 is 157.
Storing Numbers
Storing Numbers
How? Just plot the table of the binary
values from 1, 2, 4, 8, 16, 32, 64 and so
forth below on the binary given.
Example:
1 0 1 1 1 0
32 16 8 4 2 1
Binary to decimal conversion – Simple way
Cancel all Zeros and Add all Ones
Then find the sum of 32, 8, 4 and 2.
Example:
1 0 1 1 1 0
32 16 8 4 2 1
Binary to Decimal conversion
• 101110
• 101010
• 11100101
• 101111011
• 1001011110
Try to convert, binary to decimal.
• 101110 - 46
• 101010 - 42
• 11100101 - 229
• 101111011 - 379
• 1001011110 - 606
Try to convert, binary to decimal.
Decimal to Binary Conversion
How? Just plot the table of the binary
values from 1, 2, 4, 8, 16, 32, 64 and so
forth.
Example: 46 is the given value
64 32 16 8 4 2 1
0 1 0 1 1 1 0
Decimal to Binary Conversion
• 128
• 201
• 134
• 96
• 52
Try to convert, decimal to binary .
• 128 – 1 0 0 0 0 0 0 0
• 201 – 1 1 0 0 1 0 0 1
• 134 – 1 0 0 0 0 1 1 0
• 96 – 1 1 0 0 0 0 0
• 52 – 1 1 0 1 0 0
Try to convert, decimal to binary .
In binary addition there is a magic table
(rule).
1 + 1 = 0 carry 1
1 + 0 = 1
0 + 1 = 1
0 + 0 = 0
Binary Addition
How to add binary numbers?
Example:
1 0 1 1
+ 0 1 0 0
1
Binary Addition
How to add binary numbers?
Example:
1 0 1 1
+ 0 1 0 0
1 1
Binary Addition
How to add binary numbers?
Example:
1 0 1 1
+ 0 1 0 0
1 1 1
Binary Addition
How to add binary numbers?
Example:
1 0 1 1
+ 0 1 0 0
1 1 1 1
Binary Addition
Another example with carry.
Binary Addition
How to add binary numbers?
Example:
1 0 1 1 0
+ 0 1 1 0 1
1 0 0 0 1 1
Binary Addition
How to check if it is correct?
32 16 8 4 2 1
1 0 1 1 0
+ 0 1 1 0 1
1 0 0 0 1 1
Binary Addition
And add all 1’s and cross-out all 0’s.
32 16 8 4 2 1
1 0 1 1 0 - 22
+ 0 1 1 0 1 - 13
1 0 0 0 1 1 - 35
Binary Addition
Prepare ½ cross wise clean yellow pad
A.1 1 1 1 + 10101 =
B. 1011111 + 10111 =
C. 11011011 + 11010111 =
D.1110111111 + 1101100111 =
Binary Addition
In binary subtraction there is a magic table
(rule).
Binary Subtraction
Example # 1.
Binary Subtraction
How to check if it is correct? Simply plot
the position values at the top.
Binary Subtraction
Binary Subtraction
Binary Subtraction
Binary Subtraction
Binary Subtraction
Example with a carry.
Binary Subtraction
Example with a carry.
Binary Subtraction
Example with a carry.
Binary Subtraction
Example with a carry.
Try to check if
it is correct.
Binary Subtraction
Another example with more carries.
Binary Subtraction
Another example with more carries.
Binary Subtraction
Another example with more carries.
Binary Subtraction
Another example with more carries.
Binary Subtraction
Checking….
Binary Subtraction
Checking….
Binary Subtraction
Prepare ½ cross wise clean yellow pad
A.101 – 011 =
B. 1111 – 0101 =
C. 10101 – 01010 =
D.11101 – 10110 =
Binary Subtraction
Developed in the 1830s and 1840s by
Samuel Morse (1791-1872) and other
inventors, the telegraph revolutionized
long-distance communication. It worked
by transmitting electrical signals over a
wire laid between stations.
Morse Code & theTelegraph
In addition to helping invent the
telegraph, Samuel Morse developed a
code (bearing his name) that assigned a
set of dots and dashes to each letter of
the English alphabet and allowed for the
simple transmission of complex messages
across telegraph lines.
Morse Code & theTelegraph
In 1844, Morse sent his first telegraph
message, from Washington, D.C., to
Baltimore, Maryland; by 1866, a
telegraph line had been laid across the
Atlantic Ocean from the U.S. to Europe.
Morse Code & theTelegraph
Although the telegraph had fallen out of
widespread use by the start of the 21st
century, replaced by the telephone, fax
machine and Internet, it laid the
groundwork for the communications
revolution that led to those later
innovations.
Morse Code & theTelegraph
- dot
- det
Introduction to Computing
Example
B
S
I
S
Example
How
The class is divided into 4 groups,
each group must prepare 5 messages
using the Morse code. Write the
encrypted and decrypted messages
on a clean ¼ yellow pad paper.
Activity – Sender and Receiver
Prepare ½ Crosswise
CleanYellow Pad Paper
Pseudo code
#include <stdio.h>
main()
{
int x = 1;
if (x == 1)
printf("x is equal to one.");
else
printf(“x is not equal to one");
getch();
}
1. Write the pseudo code
#include <stdio.h>
main()
{
float prelim, midterm, semiFinal, Final, Sum, average;
clrscr();
printf(“prelim:”);
scanf(“%f”, &prelim);
printf(“midterm :”);
scanf(“%f”, &midterm);
printf(“semiFinal :”);
scanf(“%f”, &semiFinal );
printf(“Final :”);
scanf(“%f”, & );
sum = (prelim + midterm + semiFinal + Final);
printf(“Total grade: %f”, sum);
average = (sum/4);
printf(“Total Average: %f”, average );
getch();
}
2. Write the pseudo code
int x = 20;
int y = 10;
If (x < y) {
system.out.println(“x is less than y”);
}
If (x == y) {
system.out.println(“x is equal to y”);
}
If (x > y) {
system.out.println(“x is less greater than y”);
}
3. Write the pseudo code
Prepare ½ cross wise clean yellow pad
• 1101110
• 1011010
• 111010101
• 1011110111
• 10011011110
Try to convert, binary to decimal.
• 228
• 301
• 534
• 196
• 152
Try to convert, decimal to binary .
A.1 01 1 1 + 10101 =
B.1011111 + 101111 =
C.11011011 + 110101111 =
D.11101111111 + 11011001111 =
Binary Addition
A.1011 – 0110 =
B.11101 – 01111 =
C.101101 – 011010 =
D.111101 – 101110 =
Binary Subtraction
Convert into Morse code.
The quick brown fox jumps over a lazy dog.
Morse Code
Prepare for Midterm Exam

More Related Content

PDF
As Level Computer Science Book -1
DIGDARSHAN KUNWAR
 
PPT
08. Numeral Systems
Intro C# Book
 
PDF
Computer data representation (integers, floating-point numbers, text, images,...
ArtemKovera
 
PPTX
Number system
Suraj Bora
 
PPTX
Chapter 4 number system
Praveen M Jigajinni
 
PPT
Number system part 1
Excel Technology Lanka (Pvt) Ltd
 
PPTX
Data Representation
Education Front
 
As Level Computer Science Book -1
DIGDARSHAN KUNWAR
 
08. Numeral Systems
Intro C# Book
 
Computer data representation (integers, floating-point numbers, text, images,...
ArtemKovera
 
Number system
Suraj Bora
 
Chapter 4 number system
Praveen M Jigajinni
 
Number system part 1
Excel Technology Lanka (Pvt) Ltd
 
Data Representation
Education Front
 

What's hot (18)

DOCX
Number system.pdf
DeepuGuna
 
PPTX
Data representation
Ashraf Miraz
 
PPTX
Number System
Meenakshi Paul
 
PPT
Topic 1 Data Representation
ekul
 
PPTX
Data Representation
Dilum Bandara
 
PPTX
Computer architecture data representation
Anil Pokhrel
 
PPTX
Binary, Decimal and Hexadecimal
UthraSowrirajan1
 
PPT
Data representation
shashikant pabari
 
PPT
Error detection and correction codes r006
arunachalamr16
 
PDF
Data representation
Prof. Dr. K. Adisesha
 
PPTX
Data Representation
Education Front
 
PPTX
Data representation
MAGADH UNIVERSITY,BOADH GAYA
 
PPTX
Representation of Signed Numbers - R.D.Sivakumar
Sivakumar R D .
 
PDF
Data representation in computers
Prof. Dr. K. Adisesha
 
PPT
05 multiply divide
Piyush Rochwani
 
PDF
Number System and Boolean Algebra
AMIE(I) Study Circle
 
PPTX
Data Representation
Rick Jamil
 
PPTX
Codes r005
arunachalamr16
 
Number system.pdf
DeepuGuna
 
Data representation
Ashraf Miraz
 
Number System
Meenakshi Paul
 
Topic 1 Data Representation
ekul
 
Data Representation
Dilum Bandara
 
Computer architecture data representation
Anil Pokhrel
 
Binary, Decimal and Hexadecimal
UthraSowrirajan1
 
Data representation
shashikant pabari
 
Error detection and correction codes r006
arunachalamr16
 
Data representation
Prof. Dr. K. Adisesha
 
Data Representation
Education Front
 
Data representation
MAGADH UNIVERSITY,BOADH GAYA
 
Representation of Signed Numbers - R.D.Sivakumar
Sivakumar R D .
 
Data representation in computers
Prof. Dr. K. Adisesha
 
05 multiply divide
Piyush Rochwani
 
Number System and Boolean Algebra
AMIE(I) Study Circle
 
Data Representation
Rick Jamil
 
Codes r005
arunachalamr16
 
Ad

Similar to Introduction to Computing (20)

PPT
Number_System and Boolean Algebra in Digital System Design
Deepika rani sona
 
PPT
digitalelectronics.ppt
HarshalVaidya11
 
PPT
Number Systems.ppt
GnanaDeepikaMeduri
 
PPT
Chapter 1 Digital Systems and Binary Numbers.ppt
AparnaDas827261
 
DOCX
HexaDecimal-Number-Syatem-Use.-from-computer-science-subject-code-2210.docx
Orin18
 
PDF
form-3-computer studies summarized NOTES.pdf
gerrardmunge1
 
PPT
Chapter 02 Data Types
Nathan Yeung
 
PPTX
09 binary number systems
Lee Chadwick
 
PDF
01 number systems-students
meomeobsu
 
PDF
Digital and Logic Design Chapter 1 binary_systems
Imran Waris
 
PPT
1. basic theories of information
'Cedrick SuperGreenilistic Expialidocious Antonino
 
PPT
digital___electronics___EXPLAINATION.ppt
Harshal Vaidya
 
PPTX
Presentation of ICT.ppt.pptx
MinahilUmar1
 
PPT
Digital logic design part1
Vaagdevi College of Engineering
 
PPTX
Digital Logic Design.pptx
AminaZahid16
 
PDF
Module 1 Digital Logic Design .pptx.pdf
tweetya25
 
PDF
Binary overview
Januário Esteves
 
PDF
silo.tips_-chapter-1-the-binary-number-system-11-why-binary.pdf
ssuserf7cd2b
 
PDF
Chapter 1 digital systems and binary numbers
Mohammad Bashartullah
 
PPTX
Number_systems_for _o_& _A_levels by fari
Fari84
 
Number_System and Boolean Algebra in Digital System Design
Deepika rani sona
 
digitalelectronics.ppt
HarshalVaidya11
 
Number Systems.ppt
GnanaDeepikaMeduri
 
Chapter 1 Digital Systems and Binary Numbers.ppt
AparnaDas827261
 
HexaDecimal-Number-Syatem-Use.-from-computer-science-subject-code-2210.docx
Orin18
 
form-3-computer studies summarized NOTES.pdf
gerrardmunge1
 
Chapter 02 Data Types
Nathan Yeung
 
09 binary number systems
Lee Chadwick
 
01 number systems-students
meomeobsu
 
Digital and Logic Design Chapter 1 binary_systems
Imran Waris
 
1. basic theories of information
'Cedrick SuperGreenilistic Expialidocious Antonino
 
digital___electronics___EXPLAINATION.ppt
Harshal Vaidya
 
Presentation of ICT.ppt.pptx
MinahilUmar1
 
Digital logic design part1
Vaagdevi College of Engineering
 
Digital Logic Design.pptx
AminaZahid16
 
Module 1 Digital Logic Design .pptx.pdf
tweetya25
 
Binary overview
Januário Esteves
 
silo.tips_-chapter-1-the-binary-number-system-11-why-binary.pdf
ssuserf7cd2b
 
Chapter 1 digital systems and binary numbers
Mohammad Bashartullah
 
Number_systems_for _o_& _A_levels by fari
Fari84
 
Ad

More from Mark John Lado, MIT (20)

PDF
Exploring Parts of Speech, Creating Strong Objectives, and Choosing the Right...
Mark John Lado, MIT
 
PDF
Optimizing Embedded System Device Communication with Network Topology Design
Mark John Lado, MIT
 
PDF
Embedded Systems IO Peripherals Wireless Communication.pdf
Mark John Lado, MIT
 
PDF
Implementing the 6S Lean Methodology for Streamlined Computer System Maintena...
Mark John Lado, MIT
 
PDF
ISO IEC 25010 2011 Systems and Software Quality Requirements and Evaluation S...
Mark John Lado, MIT
 
PDF
4 Module - Operating Systems Configuration and Use by Mark John Lado
Mark John Lado, MIT
 
PDF
3 Module - Operating Systems Configuration and Use by Mark John Lado
Mark John Lado, MIT
 
PDF
1 Module - Operating Systems Configuration and Use by Mark John Lado
Mark John Lado, MIT
 
PDF
2 Module - Operating Systems Configuration and Use by Mark John Lado
Mark John Lado, MIT
 
PPSX
PART 1 CT-318-Microprocessor-Systems Lesson 3 - LED Display by Mark John Lado...
Mark John Lado, MIT
 
PPSX
PART 2 CT-318-Microprocessor-Systems Lesson 3 - LED Display by Mark John Lado...
Mark John Lado, MIT
 
PPSX
PART 3 CT-318-Microprocessor-Systems Lesson 3 - LED Display by Mark John Lado...
Mark John Lado, MIT
 
PPSX
Dart Programming Language by Mark John Lado
Mark John Lado, MIT
 
PPTX
What is CRUD in TPS?
Mark John Lado, MIT
 
PPSX
Computer hacking and security - Social Responsibility of IT Professional by M...
Mark John Lado, MIT
 
PDF
A WIRELESS DIGITAL PUBLIC ADDRESS WITH VOICE ALARM AND TEXT-TO-SPEECH FEATURE...
Mark John Lado, MIT
 
PPTX
IT Security and Management - Semi Finals by Mark John Lado
Mark John Lado, MIT
 
PPTX
IT Security and Management - Security Policies
Mark John Lado, MIT
 
PPTX
Systems Administration - MARK JOHN LADO
Mark John Lado, MIT
 
PPTX
IT Security and Management - Prelim Lessons by Mark John Lado
Mark John Lado, MIT
 
Exploring Parts of Speech, Creating Strong Objectives, and Choosing the Right...
Mark John Lado, MIT
 
Optimizing Embedded System Device Communication with Network Topology Design
Mark John Lado, MIT
 
Embedded Systems IO Peripherals Wireless Communication.pdf
Mark John Lado, MIT
 
Implementing the 6S Lean Methodology for Streamlined Computer System Maintena...
Mark John Lado, MIT
 
ISO IEC 25010 2011 Systems and Software Quality Requirements and Evaluation S...
Mark John Lado, MIT
 
4 Module - Operating Systems Configuration and Use by Mark John Lado
Mark John Lado, MIT
 
3 Module - Operating Systems Configuration and Use by Mark John Lado
Mark John Lado, MIT
 
1 Module - Operating Systems Configuration and Use by Mark John Lado
Mark John Lado, MIT
 
2 Module - Operating Systems Configuration and Use by Mark John Lado
Mark John Lado, MIT
 
PART 1 CT-318-Microprocessor-Systems Lesson 3 - LED Display by Mark John Lado...
Mark John Lado, MIT
 
PART 2 CT-318-Microprocessor-Systems Lesson 3 - LED Display by Mark John Lado...
Mark John Lado, MIT
 
PART 3 CT-318-Microprocessor-Systems Lesson 3 - LED Display by Mark John Lado...
Mark John Lado, MIT
 
Dart Programming Language by Mark John Lado
Mark John Lado, MIT
 
What is CRUD in TPS?
Mark John Lado, MIT
 
Computer hacking and security - Social Responsibility of IT Professional by M...
Mark John Lado, MIT
 
A WIRELESS DIGITAL PUBLIC ADDRESS WITH VOICE ALARM AND TEXT-TO-SPEECH FEATURE...
Mark John Lado, MIT
 
IT Security and Management - Semi Finals by Mark John Lado
Mark John Lado, MIT
 
IT Security and Management - Security Policies
Mark John Lado, MIT
 
Systems Administration - MARK JOHN LADO
Mark John Lado, MIT
 
IT Security and Management - Prelim Lessons by Mark John Lado
Mark John Lado, MIT
 

Recently uploaded (20)

PPTX
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
DOCX
Action Plan_ARAL PROGRAM_ STAND ALONE SHS.docx
Levenmartlacuna1
 
DOCX
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
PPTX
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
PDF
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
PDF
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PDF
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
DOCX
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
PPTX
CDH. pptx
AneetaSharma15
 
PPTX
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PPTX
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PPTX
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
Information Texts_Infographic on Forgetting Curve.pptx
Tata Sevilla
 
Action Plan_ARAL PROGRAM_ STAND ALONE SHS.docx
Levenmartlacuna1
 
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
Health-The-Ultimate-Treasure (1).pdf/8th class science curiosity /samyans edu...
Sandeep Swamy
 
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
CDH. pptx
AneetaSharma15
 
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 

Introduction to Computing

  • 2. In the connection of C programming and flowcharting, in this topic you will learn on how to use algorithms. Stay focus and study hard!
  • 3. You will be able to 1. define pseudo code 2. write pseudo code on a specific problem 3. know the importance of algorithms Objectives
  • 4. Pseudo code is an informal high-level description of the operating principle of a computer program or other algorithm. It uses the structural conventions of a normal programming language, but is intended for human reading rather than machine reading. Pseudo code
  • 5. #include <stdio.h> main() { printf("Hello Worldn"); getch(); } C / C++ Code and Pseudo Code Start Header files Opening bracket display HelloWorld Get the character Closing bracket End
  • 6. #include <stdio.h> main() { int x = 1; if (x == 1) printf("x is equal to one."); else printf(“x is not equal to one"); getch(); } Write the pseudo code
  • 7. Start Header files Opening bracket Declaring x as integer and is equal to one if x is equal to one then print the statement x is equal to one else print the statement x is not equal to one Get the character Closing bracket End Pseudo code of the given previous code
  • 8. You already had a fundamentals of writing an algorithms. What’s next? In the next topic you will be introduced on how computers store data. Stay in focus! Heads up!
  • 10. You will be able to 1. determine the function of 1 and 0 2. recognize different types of number systems as they relate to computers. 3. add and subtract in binary 4. convert values from decimal, binary Objectives
  • 11. Concept: All data that is stored in a computer is converted to sequences of Zero’s and One’s. Binary Number Systems
  • 12. A computer’s memory is divided into tiny storage locations known as bytes. One byte is only enough memory to store a letter of the alphabet or a small number. Binary Number Systems
  • 13. In order to do anything meaningful, a computer has to have lots of bytes. Most computers today have millions, or even billions, of bytes of memory. Binary Number Systems
  • 14. Each byte is divided into eight smaller storage locations known as bits. The term bits stands for binary digit. Computer scientists usually think of bits as tiny switches that can be either on or off. Binary Number Systems
  • 15. Bits aren’t actual “switches,” however, at least not in the conventional sense. In most computer systems, bits are tiny electrical components that can hold either a positive or a negative charge. Binary Number Systems
  • 16. Computer scientists think of a positive charge as a switch in the on position, and a negative charge as a switch in the off position. Binary Number Systems
  • 18. Figure shows the way that a computer scientist might think of a byte of memory: as a collection of switches that are each flipped to either the on or off position. Binary Number Systems
  • 19. When a piece of data is stored in a byte, the computer sets the eight bits to an on/off pattern that represents the data. Binary Number Systems
  • 20. A bit can be used in a very limited way to represent numbers. Depending on whether the bit is turned on or off, it can represent one of two different values. Storing Numbers
  • 21. In computer systems, a bit that is turned off represents the number 0 and a bit that is turned on represents the number 1. This corresponds perfectly to the binary numbering system. Storing Numbers
  • 22. In the binary numbering system (or binary, as it is usually called) all numeric values are written as sequences of 0s and 1s. Storing Numbers
  • 23. Here is an example of a number that is written in binary: 10011101 Storing Numbers
  • 24. The position of each digit in a binary number has a value assigned to it. Starting with the rightmost digit and moving left, the position values are 2^0 , 2^1 , 2^2 , 2^3 , and so forth. Storing Numbers
  • 26. Next figure shows the same diagram with the position values calculated. Starting with the rightmost digit and moving left, the position values are 1, 2, 4, 8, and so forth. Storing Numbers
  • 28. To determine the value of a binary number you simply add up the position values of all the 1s. For example, in the binary number 10011101, the position values of the 1s are 1, 4, 8, 16, and 128. Storing Numbers
  • 29. The sum of all of these position values is 157. So, the value of the binary number 10011101 is 157. Storing Numbers
  • 31. How? Just plot the table of the binary values from 1, 2, 4, 8, 16, 32, 64 and so forth below on the binary given. Example: 1 0 1 1 1 0 32 16 8 4 2 1 Binary to decimal conversion – Simple way
  • 32. Cancel all Zeros and Add all Ones Then find the sum of 32, 8, 4 and 2. Example: 1 0 1 1 1 0 32 16 8 4 2 1 Binary to Decimal conversion
  • 33. • 101110 • 101010 • 11100101 • 101111011 • 1001011110 Try to convert, binary to decimal.
  • 34. • 101110 - 46 • 101010 - 42 • 11100101 - 229 • 101111011 - 379 • 1001011110 - 606 Try to convert, binary to decimal.
  • 35. Decimal to Binary Conversion
  • 36. How? Just plot the table of the binary values from 1, 2, 4, 8, 16, 32, 64 and so forth. Example: 46 is the given value 64 32 16 8 4 2 1 0 1 0 1 1 1 0 Decimal to Binary Conversion
  • 37. • 128 • 201 • 134 • 96 • 52 Try to convert, decimal to binary .
  • 38. • 128 – 1 0 0 0 0 0 0 0 • 201 – 1 1 0 0 1 0 0 1 • 134 – 1 0 0 0 0 1 1 0 • 96 – 1 1 0 0 0 0 0 • 52 – 1 1 0 1 0 0 Try to convert, decimal to binary .
  • 39. In binary addition there is a magic table (rule). 1 + 1 = 0 carry 1 1 + 0 = 1 0 + 1 = 1 0 + 0 = 0 Binary Addition
  • 40. How to add binary numbers? Example: 1 0 1 1 + 0 1 0 0 1 Binary Addition
  • 41. How to add binary numbers? Example: 1 0 1 1 + 0 1 0 0 1 1 Binary Addition
  • 42. How to add binary numbers? Example: 1 0 1 1 + 0 1 0 0 1 1 1 Binary Addition
  • 43. How to add binary numbers? Example: 1 0 1 1 + 0 1 0 0 1 1 1 1 Binary Addition
  • 44. Another example with carry. Binary Addition
  • 45. How to add binary numbers? Example: 1 0 1 1 0 + 0 1 1 0 1 1 0 0 0 1 1 Binary Addition
  • 46. How to check if it is correct? 32 16 8 4 2 1 1 0 1 1 0 + 0 1 1 0 1 1 0 0 0 1 1 Binary Addition
  • 47. And add all 1’s and cross-out all 0’s. 32 16 8 4 2 1 1 0 1 1 0 - 22 + 0 1 1 0 1 - 13 1 0 0 0 1 1 - 35 Binary Addition
  • 48. Prepare ½ cross wise clean yellow pad A.1 1 1 1 + 10101 = B. 1011111 + 10111 = C. 11011011 + 11010111 = D.1110111111 + 1101100111 = Binary Addition
  • 49. In binary subtraction there is a magic table (rule). Binary Subtraction
  • 50. Example # 1. Binary Subtraction
  • 51. How to check if it is correct? Simply plot the position values at the top. Binary Subtraction
  • 56. Example with a carry. Binary Subtraction
  • 57. Example with a carry. Binary Subtraction
  • 58. Example with a carry. Binary Subtraction
  • 59. Example with a carry. Try to check if it is correct. Binary Subtraction
  • 60. Another example with more carries. Binary Subtraction
  • 61. Another example with more carries. Binary Subtraction
  • 62. Another example with more carries. Binary Subtraction
  • 63. Another example with more carries. Binary Subtraction
  • 66. Prepare ½ cross wise clean yellow pad A.101 – 011 = B. 1111 – 0101 = C. 10101 – 01010 = D.11101 – 10110 = Binary Subtraction
  • 67. Developed in the 1830s and 1840s by Samuel Morse (1791-1872) and other inventors, the telegraph revolutionized long-distance communication. It worked by transmitting electrical signals over a wire laid between stations. Morse Code & theTelegraph
  • 68. In addition to helping invent the telegraph, Samuel Morse developed a code (bearing his name) that assigned a set of dots and dashes to each letter of the English alphabet and allowed for the simple transmission of complex messages across telegraph lines. Morse Code & theTelegraph
  • 69. In 1844, Morse sent his first telegraph message, from Washington, D.C., to Baltimore, Maryland; by 1866, a telegraph line had been laid across the Atlantic Ocean from the U.S. to Europe. Morse Code & theTelegraph
  • 70. Although the telegraph had fallen out of widespread use by the start of the 21st century, replaced by the telephone, fax machine and Internet, it laid the groundwork for the communications revolution that led to those later innovations. Morse Code & theTelegraph
  • 75. The class is divided into 4 groups, each group must prepare 5 messages using the Morse code. Write the encrypted and decrypted messages on a clean ¼ yellow pad paper. Activity – Sender and Receiver
  • 76. Prepare ½ Crosswise CleanYellow Pad Paper Pseudo code
  • 77. #include <stdio.h> main() { int x = 1; if (x == 1) printf("x is equal to one."); else printf(“x is not equal to one"); getch(); } 1. Write the pseudo code
  • 78. #include <stdio.h> main() { float prelim, midterm, semiFinal, Final, Sum, average; clrscr(); printf(“prelim:”); scanf(“%f”, &prelim); printf(“midterm :”); scanf(“%f”, &midterm); printf(“semiFinal :”); scanf(“%f”, &semiFinal ); printf(“Final :”); scanf(“%f”, & ); sum = (prelim + midterm + semiFinal + Final); printf(“Total grade: %f”, sum); average = (sum/4); printf(“Total Average: %f”, average ); getch(); } 2. Write the pseudo code
  • 79. int x = 20; int y = 10; If (x < y) { system.out.println(“x is less than y”); } If (x == y) { system.out.println(“x is equal to y”); } If (x > y) { system.out.println(“x is less greater than y”); } 3. Write the pseudo code
  • 80. Prepare ½ cross wise clean yellow pad • 1101110 • 1011010 • 111010101 • 1011110111 • 10011011110 Try to convert, binary to decimal.
  • 81. • 228 • 301 • 534 • 196 • 152 Try to convert, decimal to binary .
  • 82. A.1 01 1 1 + 10101 = B.1011111 + 101111 = C.11011011 + 110101111 = D.11101111111 + 11011001111 = Binary Addition
  • 83. A.1011 – 0110 = B.11101 – 01111 = C.101101 – 011010 = D.111101 – 101110 = Binary Subtraction
  • 84. Convert into Morse code. The quick brown fox jumps over a lazy dog. Morse Code