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

Number system....
Number system....Number system....
Number system....
mshoaib15
 

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

01.number systems
01.number systems01.number systems
01.number systems
rasha3
 

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

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Recently uploaded (20)

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...
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
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
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
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
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
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
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
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
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.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
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 

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