2 - ComputerOrganization - Data Rep
2 - ComputerOrganization - Data Rep
1 2 3 . 3 2 1
1 0 1 . 0 1 1
MSB LSB
100 = 1
101 = 10
102 = 100
103 = 1000
104 = 10000
• So a denary number 248 is expanded in Base 10
system as
2x102 + 4x101 + 8x100
Binary System concept
• Base 2 system
20 = 1
21 = 2
22 = 4
23 = 8
24 = 16
25 = 32 and so on
• So a binary number 110 is expanded in base 2
system as
1x22 + 1x 21 + 0x20
How to convert a binary number to denary?
• Example 1
• Binary 1110
0 x 20 = 0
1 x 21 = 2
1 x 22 = 4
1 x 23 = 8
Total = 14
Equivalent Denary Number = 14
How to convert a binary number to denary?
• Example 2
• Binary 101101010
0 x 20 = 0
1 x 21 = 2
0 x 22 = 0
1 x 23 = 8
0 x 24 = 0
1 x 25 = 32
1 x 26 = 64
0 x 27 = 0
1 x 28 = 256
Total = 256 + 64 + 32 + 8 + 4 + 2 = 362
How to convert a denary number to binary?
• We also follow successive or repetitive division by 2.
• This is more methodical.
• Example
• Take a denary number 245.
2| 245
2| Quotient 122 – Remainder 1
2| Quotient 61 – Remainder 0
2| Quotient 30 – Remainder 1
2| Quotient 15 – Remainder 0
2| Quotient 7 – Remainder 1
2| Quotient 3 – Remainder 1
2| Quotient 1 – Remainder 1
2| Quotient 0 – Remainder 1
http://www3.ntu.edu.sg/home/ehchua/programming/java/
datarepresentation.html
Introduction
• Basic Gates
• 1. NOT gate
• 2. AND gate
• 3. OR gate
• 4. NAND gate
• 5. NOR gate
• 6. XOR gate.
• Logic diagram - A graphical representation of a
circuit
– Each type of gate is represented by a specific
graphical symbol
• Truth table - A table showing all possible input
values and the associated output values
Symbols Used
NOT GATE
• A NOT gate accepts one input value and
produces one output value
• Fundamental laws
• If X ≠ 0 then X = 1
• If X ≠ 1 then X = 0
• OR Relations
– 0+0=0
– 0+1=1
– 1+0=1
– 1+1=1
• AND Relations
– 0.0=0
– 0.1=0
– 1.0=0
– 1.1=1
• Complement Rules
– 0=1
– 1=0
Basic Theorems
• 0+X=X
• 1+X=1
• 0.X=0
• 1.X=X
• X+X=X
• X.X=X
• X’’ = X
• Draw a logic network and truth table to show all the possible situations when the stop
signal could be received.
Example
• The first thing to do is to try and turn the question into a series of logic gates and
then the problem becomes much simplified.
• The first statement can be re-written as: (L = 1 AND V = NOT 1) since Length > 100
meters
• corresponds to a binary value of 1 and Velocity < 10 m/s corresponds to a binary
value of 0 (i.e. NOT 1).
• Both these statements are joined together by OR which gives us the logic
statement:
1 1 1 0 For Row 7
A.B.C’
Combine with OR
X = A’.B’.C + A.B.C’
TOK – Reason as a way of knowing
• involves the use of logic and rational thinking
to derive knowledge, make decisions, and
solve problem.
• Logic is formed in terms of circuits.
• There are only 2 answers – Yes or No. There
are no partial answers.
• Clarity and Precision in conclusions or
decisions