SlideShare a Scribd company logo
1 of 21
Foundation of Computer Science

Junior Programmer Camp #8
Chapter 1: Number Systems & Radix Number
Radix Numbers
• Base 2 (Binary)
- 0, 1
• Base 8 (Octal)
- 0, 1, 2, 3, 4, 5, 6, 7
• Base 10 (Decimal)
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
• Base 16 (Hexadecimal)
– 0, 1, 2, 3 , …, 8, 9, A, B, C, D, E, F
Base Conversion
Base X to Base 10 (Decimal)
– Starting from the last digit, multiply
that digit by X0
– Increase the power of X by 1 and
repeat until you have done all digits
– Sum up the results
Base Conversion (cont.)
Example:
Convert 110112, 5467, 878 to base 10

Result :
27
279
71
Base Conversion (cont.)
Base 10 (Decimal) to any base X
– Divide the number by X.
– Write down the remainder.
– Repeat the previous two steps until
the result is 0.
– The actual result is the digit sequence
of the remainders from the last to first.
Base Conversion (cont.)
Example:
Convert 34510 to base 2,3,16

Result:
1010110012
11021203
15916
Base Conversion (cont.)
Base 2 (Binary) to Base 8 (Octal)
– Group 3 digits from the right side
– Convert each group to its octal
representation
Do you think that number in base 2 can
also be converted to Base 16
(Hexadecimal) directly somehow?
Binary Arithmetic
• Addition:
0+0=0

1+0=1

0+1=1

1 + 1 = 10

• Subtraction:
0–0=0 1–0=1

0–1=1

1-1=0

• Multiplication:
0x0=0 1x0=0

0x1=0

1x1=1
Binary Arithmetic (Try it!)
Example:
101001101 + 111110101
1001001011 - 11011101
11101 x 11001
Chapter 2: Logic Gates & Circuits
Gates and Circuits Simulator

http://logic.ly/demo/
NOT Gate

Boolean expression : A’
Truth table:
Input

Output

0

1

1

0
AND & NAND Gate

Boolean expression : A ∙ B
[AND]
(A ∙ B)’ [NAND]
Truth table:
Input
Output
A

B

AND

NAND

0

0

0

1

0

1

0

1

1

0

0

1

1

1

1

0
OR & NOR Gate

Boolean expression : A + B
[OR]
(A + B)’ [NOR]
Truth table:
Input
Output
A

B

OR

NOR

0

0

0

1

0

1

1

0

1

0

1

0

1

1

1

0
XOR & XNOR Gate

Boolean expression : A B
[XOR]
(A B)’ [XNOR]
Truth table:
Input
Output
A

B

XOR

XNOR

0

0

0

1

0

1

1

0

1

0

1

0

1

1

0

1
Circuits
A circuit is a combination of gates.
Boolean expression
Boolean expression is
D = (A + B)’
E = B ∙ C
Q = D + E
= (A + B)’+(B ∙ C)

NOT (A OR B)
B AND C
D OR E
(NOT (A OR B)) OR (B AND C)
Truth table
Input

Output

A

B

C

D
(A + B)’

E
(B ∙ C )

Q
((A + B)’+(B ∙ C) )

0

0

0

1

0

1

0

0

1

1

0

1

0

1

0

0

0

0

0

1

1

0

1

1

1

0

0

0

0

0

1

0

1

0

0

0

1

1

0

0

0

0

1

1

1

0

1

1
Give it a try!
Find the Boolean expression and
the truth table of this circuit.
Give it a try!
Draw a circuit this Boolean expression:
X = ((A

B) + (C’∙ D))’

E

More Related Content

What's hot (20)

Number system computer fundamental
 Number  system computer fundamental  Number  system computer fundamental
Number system computer fundamental
 
number system
number systemnumber system
number system
 
Conversion of number system with base concept
Conversion of number system with base conceptConversion of number system with base concept
Conversion of number system with base concept
 
Basic of number system
Basic of number systemBasic of number system
Basic of number system
 
Number system
Number systemNumber system
Number system
 
Number system conversion
Number system conversionNumber system conversion
Number system conversion
 
Octal to Hexadecimal and Hexadecimal to Octal
Octal to Hexadecimal  and Hexadecimal to OctalOctal to Hexadecimal  and Hexadecimal to Octal
Octal to Hexadecimal and Hexadecimal to Octal
 
Number System Conversion | BCA
Number System Conversion | BCANumber System Conversion | BCA
Number System Conversion | BCA
 
08. Numeral Systems
08. Numeral Systems08. Numeral Systems
08. Numeral Systems
 
Number Systems
Number SystemsNumber Systems
Number Systems
 
Binary number systems
Binary number systemsBinary number systems
Binary number systems
 
Number System & Data Representation
Number System & Data RepresentationNumber System & Data Representation
Number System & Data Representation
 
Number system
Number systemNumber system
Number system
 
Number systems
Number systemsNumber systems
Number systems
 
01.number systems
01.number systems01.number systems
01.number systems
 
Okkkkk
OkkkkkOkkkkk
Okkkkk
 
Number system....
Number system....Number system....
Number system....
 
Representation Of Numbers and Characters
Representation Of Numbers and CharactersRepresentation Of Numbers and Characters
Representation Of Numbers and Characters
 
number system
number systemnumber system
number system
 
Number systems
Number systemsNumber systems
Number systems
 

Similar to JPC#8 Foundation of Computer Science

21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptxGobinathAECEJRF1101
 
Chapter two FHI.pptx
Chapter two FHI.pptxChapter two FHI.pptx
Chapter two FHI.pptxODAATUBE1
 
Chapter 1 digital design.pptx
Chapter 1 digital design.pptxChapter 1 digital design.pptx
Chapter 1 digital design.pptxAliaaTarek5
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptxamudhak10
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptxamudhak10
 
01.number systems
01.number systems01.number systems
01.number systemsrasha3
 
Chapter_1_Digital_Systems_and_Binary_Numbers2.ppt
Chapter_1_Digital_Systems_and_Binary_Numbers2.pptChapter_1_Digital_Systems_and_Binary_Numbers2.ppt
Chapter_1_Digital_Systems_and_Binary_Numbers2.pptDavid Louie Bedia
 
Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital ElectronicsJanki Shah
 
Chapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbersChapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbersMohammad Bashartullah
 
data representation
 data representation data representation
data representationHaroon_007
 
Number system and their conversion
Number system and their conversionNumber system and their conversion
Number system and their conversionRam Pratap Singh
 
Number system by ammar nawab
Number system by ammar nawabNumber system by ammar nawab
Number system by ammar nawabAmmar_n
 

Similar to JPC#8 Foundation of Computer Science (20)

21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx
 
Chapter two FHI.pptx
Chapter two FHI.pptxChapter two FHI.pptx
Chapter two FHI.pptx
 
Chapter 1 digital design.pptx
Chapter 1 digital design.pptxChapter 1 digital design.pptx
Chapter 1 digital design.pptx
 
Digital Electronics Notes.pdf
Digital Electronics Notes.pdfDigital Electronics Notes.pdf
Digital Electronics Notes.pdf
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
 
01.number systems
01.number systems01.number systems
01.number systems
 
Chapter_1_Digital_Systems_and_Binary_Numbers2.ppt
Chapter_1_Digital_Systems_and_Binary_Numbers2.pptChapter_1_Digital_Systems_and_Binary_Numbers2.ppt
Chapter_1_Digital_Systems_and_Binary_Numbers2.ppt
 
Cit 1101 lec 02
Cit 1101 lec 02Cit 1101 lec 02
Cit 1101 lec 02
 
Number system
Number systemNumber system
Number system
 
uyuyuy.pdf
uyuyuy.pdfuyuyuy.pdf
uyuyuy.pdf
 
UNIT-1_CSA.pdf
UNIT-1_CSA.pdfUNIT-1_CSA.pdf
UNIT-1_CSA.pdf
 
Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital Electronics
 
Number_Systems (2).ppt
Number_Systems (2).pptNumber_Systems (2).ppt
Number_Systems (2).ppt
 
Chapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbersChapter 1 digital systems and binary numbers
Chapter 1 digital systems and binary numbers
 
data representation
 data representation data representation
data representation
 
Number system and their conversion
Number system and their conversionNumber system and their conversion
Number system and their conversion
 
Number system by ammar nawab
Number system by ammar nawabNumber system by ammar nawab
Number system by ammar nawab
 
Number systems
Number systemsNumber systems
Number systems
 
Cse115 lecture01numbersystems
Cse115 lecture01numbersystemsCse115 lecture01numbersystems
Cse115 lecture01numbersystems
 

More from Pathomchon Sriwilairit

More from Pathomchon Sriwilairit (6)

Social Networks: Opinion Presentation
Social Networks: Opinion PresentationSocial Networks: Opinion Presentation
Social Networks: Opinion Presentation
 
Will the tissue get wet? Mini-science experiment
Will the tissue get wet? Mini-science experimentWill the tissue get wet? Mini-science experiment
Will the tissue get wet? Mini-science experiment
 
JPC#8 Introduction to Java Programming
JPC#8 Introduction to Java ProgrammingJPC#8 Introduction to Java Programming
JPC#8 Introduction to Java Programming
 
JQuery - Effect - Animate method
JQuery - Effect - Animate methodJQuery - Effect - Animate method
JQuery - Effect - Animate method
 
20131028 Techniques of Addictive Games
20131028 Techniques of Addictive Games20131028 Techniques of Addictive Games
20131028 Techniques of Addictive Games
 
20131014 Designing Slides Layout
20131014 Designing Slides Layout20131014 Designing Slides Layout
20131014 Designing Slides Layout
 

Recently uploaded

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 

Recently uploaded (20)

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 

JPC#8 Foundation of Computer Science

  • 1. Foundation of Computer Science Junior Programmer Camp #8
  • 2. Chapter 1: Number Systems & Radix Number
  • 3. Radix Numbers • Base 2 (Binary) - 0, 1 • Base 8 (Octal) - 0, 1, 2, 3, 4, 5, 6, 7 • Base 10 (Decimal) - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 • Base 16 (Hexadecimal) – 0, 1, 2, 3 , …, 8, 9, A, B, C, D, E, F
  • 4. Base Conversion Base X to Base 10 (Decimal) – Starting from the last digit, multiply that digit by X0 – Increase the power of X by 1 and repeat until you have done all digits – Sum up the results
  • 5. Base Conversion (cont.) Example: Convert 110112, 5467, 878 to base 10 Result : 27 279 71
  • 6. Base Conversion (cont.) Base 10 (Decimal) to any base X – Divide the number by X. – Write down the remainder. – Repeat the previous two steps until the result is 0. – The actual result is the digit sequence of the remainders from the last to first.
  • 7. Base Conversion (cont.) Example: Convert 34510 to base 2,3,16 Result: 1010110012 11021203 15916
  • 8. Base Conversion (cont.) Base 2 (Binary) to Base 8 (Octal) – Group 3 digits from the right side – Convert each group to its octal representation Do you think that number in base 2 can also be converted to Base 16 (Hexadecimal) directly somehow?
  • 9. Binary Arithmetic • Addition: 0+0=0 1+0=1 0+1=1 1 + 1 = 10 • Subtraction: 0–0=0 1–0=1 0–1=1 1-1=0 • Multiplication: 0x0=0 1x0=0 0x1=0 1x1=1
  • 10. Binary Arithmetic (Try it!) Example: 101001101 + 111110101 1001001011 - 11011101 11101 x 11001
  • 11. Chapter 2: Logic Gates & Circuits
  • 12. Gates and Circuits Simulator http://logic.ly/demo/
  • 13. NOT Gate Boolean expression : A’ Truth table: Input Output 0 1 1 0
  • 14. AND & NAND Gate Boolean expression : A ∙ B [AND] (A ∙ B)’ [NAND] Truth table: Input Output A B AND NAND 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0
  • 15. OR & NOR Gate Boolean expression : A + B [OR] (A + B)’ [NOR] Truth table: Input Output A B OR NOR 0 0 0 1 0 1 1 0 1 0 1 0 1 1 1 0
  • 16. XOR & XNOR Gate Boolean expression : A B [XOR] (A B)’ [XNOR] Truth table: Input Output A B XOR XNOR 0 0 0 1 0 1 1 0 1 0 1 0 1 1 0 1
  • 17. Circuits A circuit is a combination of gates.
  • 18. Boolean expression Boolean expression is D = (A + B)’ E = B ∙ C Q = D + E = (A + B)’+(B ∙ C) NOT (A OR B) B AND C D OR E (NOT (A OR B)) OR (B AND C)
  • 19. Truth table Input Output A B C D (A + B)’ E (B ∙ C ) Q ((A + B)’+(B ∙ C) ) 0 0 0 1 0 1 0 0 1 1 0 1 0 1 0 0 0 0 0 1 1 0 1 1 1 0 0 0 0 0 1 0 1 0 0 0 1 1 0 0 0 0 1 1 1 0 1 1
  • 20. Give it a try! Find the Boolean expression and the truth table of this circuit.
  • 21. Give it a try! Draw a circuit this Boolean expression: X = ((A B) + (C’∙ D))’ E