Presentation is loading. Please wait.

Presentation is loading. Please wait.

Decimal Binary Octal Hex

Similar presentations


Presentation on theme: "Decimal Binary Octal Hex"— Presentation transcript:

1 Decimal Binary Octal Hex
Number systems, Binary Logic, Gates Number systems: Roman vs Arabic The importance of "zero“: significance of position of digits in a number Decimal Binary Octal Hex A B C D E F

2 Number systems Equivalence of numbers in different systems
Convert 258 to Decimal Convert 2510 to Octal

3 Coding: Binary representation of non-numbers
ASCII Octal characters |000 NUL|001 SOH|002 STX|003 ETX|004 EOT|005 ENQ|006 ACK|007 BEL| |010 BS |011 HT |012 NL |013 VT |014 NP |015 CR |016 SO |017 SI | |020 DLE|021 DC1|022 DC2|023 DC3|024 DC4|025 NAK|026 SYN|027 ETB| |030 CAN|031 EM |032 SUB|033 ESC|034 FS |035 GS |036 RS |037 US | |040 SP |041 ! |042 " |043 # |044 $ |045 % |046 & |047 ' | |050 ( |051 ) |052 * | |054 , | | |057 / | | | | | | | | | | | | |072 : |073 ; |074 < |075 = |076 > |077 ? | |100 @ |101 A |102 B |103 C |104 D |105 E |106 F |107 G | |110 H |111 I |112 J |113 K |114 L |115 M |116 N |117 O | |120 P |121 Q |122 R |123 S |124 T |125 U |126 V |127 W | |130 X |131 Y |132 Z |133 [ |134 \ |135 ] |136 ^ |137 _ | |140 ` |141 a |142 b |143 c |144 d |145 e |146 f |147 g | |150 h |151 i |152 j |153 k |154 l |155 m |156 n |157 o | |160 p |161 q |162 r |163 s |164 t |165 u |166 v |167 w | |170 x |171 y |172 z |173 { |174 | |175 } |176 ~ |177 DEL| Total symbols: 128 Total octal digits required ? Total binary digits required ?

4 Basis: Boolean Algebra
Binary Logic and Gates - We will use electronic circuits to control “logic” - We can construct circuits that work based on presence/absence of voltage - Logic circuits (complex) are unreliable if multiple voltage levels have different interpretations  We use BINARY LOGIC CIRCUITS Basis: Boolean Algebra

5 Basic operators of Boolean Algebra
AND OR NOT Relation of Boolean Algebra and Discrete Logic:

6 Common Logic Gates

7 Truth Tables: relation of inputs, output of an operator

8 Gates basics Functioning of an NPN transistor 5V A is ON 
LED A is ON  Small current at transistor base  Collector-Emitter conducts freely  Current through LED  LED is ON NPN transistor R1 5V R2 R3 NOR( A, B) A B A Resistor-Transistor Logic (RTL) NOR gate …you will learn these in detail in ELEC xxx

9 Some simple binary number operations
ADDITION: 2’s COMPLEMENT: - start from the least significant digit - copy bit-by-bit until (including) the first ‘1’ - inverted the remaining digits ( ‘0’  ‘1’, and ‘1’  ‘0’) Example: Binary number, b = 2's complement of b =

10 Binary number operations: motivation
Computers have ‘limited’ representations [fixed length numbers] Consider the following 4-bit additions: borrow overflow - how to represent negative numbers? - what does the ‘borrow’ mean?

11 Binary number operations: motivation..
Conventions: - Use of one extra bit, to identify overflow in addition - Reserve Most-Significant-Bit (MSB) to identify negative number - Store –ve numbers as 2’s complement of its absolute value Consequence: - MSB is 1  -ve number - replace addition by addition of 2’s complement!!

12 Binary number operations: motivation...
number (nd) binary (nb) -2's complement ( - n ) 3 0 : 0011 1 : 1101 5 0 : 0101 1 : 1011 7 0 : 0111 1 : 1001 8 0 : 1000 1 : 1000 CALCULATE: 5 - 7 -3 - 3 8 - 3

13 Boolean Algebra - Developed by George Boole
- Wanted to develop a language-based logic (“and” “or” “not”) - Boolean Algebra was used by Claude Shannon for design of logic circuits - What is algebra ? - Boolean Algebra: two constants: 0, 1 variable can take value of any constant rules to construct ‘expressions’ rules to construct statements ( expr1 = expr2) logic for testing truth of a statement

14 Boolean Algebra constants: 1, 0 symbols: (, ), , , =, ¬
variables: A, B, … Expressions: a series of symbols rules: constant variable constant OPb constant OPu constant ( expression ) ( expression ) OPb ( expression ) OPu ( expression )

15 Boolean Algebra Evaluating an expression:
- substitute the value of each variable - use truth table of operators to evaluate if X = 1, value of expression X  1 = Statement: expression = expression X  (X  Y) = 1 Truth of a statement: if the equality is true for all possible instantiations of variables X  (X  Y) = 1

16 Boolean Algebra Theorems: Statements that are always true.
Some theorems of one variable

17 Boolean Algebra Some theorems of two variables de Morgan’s theorems

18 Boolean Algebra Use of theorems: ‘simplification’ of expressions
How many gates would we need to implement the original expression? How many are needed to implement the equivalent expression?

19 Karnaugh Maps (K-Maps)
Graphical method to simplify expressions K-Map: matrix of 2n elements each element corresponds to one distinct instantiation of the variables

20 K-Maps, example T = X  (X  Y)
- Write T as a disjunction of eight conjunction terms (OR of eight AND-terms) T = X  (X  Y) = X (X  Y) = X X  XY - T = 1 if any AND-term = 1 [WHY ?] - Put a ‘1’ in each cell corresponding to each AND-term X Y 1 XY X X  XY = X  XY X Y 1 XY - Loop all 1’s into rectangular BLOCKS Loop = X = T

21 K-Maps, example - T is a disjunction of eight conjunction terms (OR of eight AND-terms) - T = 1 if any AND-term = 1 [WHY ?] - Put a ‘1’ in each cell corresponding to each AND-term A B C D 1 NOTE: Which cell corresponds to BCD ?

22 K-Maps, example How to make ‘loops’: - Must be rectangular or square
- Must contain 2n cells (1, 2, 4, 8, …) - Must contain no ‘0’ - Can join leftmost column with rightmost - Can join top row with bottom - All 1’s must belong to at least one loop - Try to maximize the size of loops

23 K-Maps construction: f cells
Example: Elevator control Elevator is going up: Switch A is ON Elevator is going down: Switch B is ON denotes that the elevator is going up denotes that the elevator is neither going up, nor down What about the state AB ? State that is physically impossible is filled with f in K-map f in K-map: may be used as 1 or 0

24 K-Maps construction prime implicant: a block which is not entirely included in a larger block essential prime implicant: a prime implicant with at least one cell that cannot be included in any other prime implicant 1. Identify input, output variables; formulate the logic expression 2. Re-write the expression: disjunction of purely conjunctive terms 3. Make the K-map 4. Fill a 1 in the cell(s) corresponding to each term, and F where possible 5. Identify and "block" each essential prime implicant. 6. If any un-blocked "1" cells remain, create corresponding prime implicant 7. Write output = disjunction of conjunctive terms (1 term for each implicant)

25


Download ppt "Decimal Binary Octal Hex"

Similar presentations


Ads by Google