User Tools

Site Tools


notes:cprog:spring2024:projects:dtr0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:cprog:spring2024:projects:dtr0 [2024/02/14 05:28] – [BITWISE LOGIC: AND] added more info hcopp1notes:cprog:spring2024:projects:dtr0 [2024/02/14 20:39] (current) – [INTEGER VALUES] cgrant9
Line 14: Line 14:
  
 In this project we are looking at 10 different types of data values, that are all variations of integers with different byte sizes: In this project we are looking at 10 different types of data values, that are all variations of integers with different byte sizes:
-<code>signed long long int --- 16 bytes +<code>signed long long int --- bytes 
-unsigned long long int --- 16 bytes+unsigned long long int --- bytes
 signed long int --- 8 bytes signed long int --- 8 bytes
 unsigned long int --- 8 bytes unsigned long int --- 8 bytes
Line 24: Line 24:
 signed char --- 1 byte signed char --- 1 byte
 unsigned char --- 1 byte</code> unsigned char --- 1 byte</code>
-As you can see they follow the pattern of long doubling, and half, halving, the exception is character, which is essentially a half half integer, in fact it would be abbreviated as either hhd or hhu depending on its signing.+
  
  
Line 61: Line 61:
 =210</code> =210</code>
 ====REPRESENTATION: BASE 16 (HEXADECIMAL)==== ====REPRESENTATION: BASE 16 (HEXADECIMAL)====
 + 
 +Hexadecimal Table:
 +
 +''0 1 2 3 4 5 6 7 8 9 A B C D E F ''
 +<code>
 +Hex     |Binary     |Decimal
 +0        0000        0
 +1        0001        1
 +2        0010        2
 +3        0011        3
 +4        0100        4
 +5        0101        5
 +6        0110        6
 +7        0111        7
 +8        1000        8
 +9        1001        9
 +A        1010        10
 +B        1011        11
 +C        1100        12
 +D        1101        13
 +E        1110        14
 +F        1111        15
 +-----------------------
 +10       00010000    16
 +20       00100000    32
 +30       00110000    48
 +40       01000000    64
 +50       01010000    80
 +60       01100000    96
 +70       01110000    112 
 +80       10000000    128
 +90       10010000    144
 +A0       10100000    160
 +B0       10110000    176
 +C0       11000000    192
 +D0       11010000    208
 +E0       11100000    224
 +F0       11110000    240
 +-------------------------
 +11       00010001    17
 +12       00010010    18
 +13       00010011    19
 +14       00010100    20
 +15       00010101    21
 +16       00010110    22
 +17       00010111    23
 +18       00011000    24
 +-------------------------
 +FF       11111111    255
 +100     100000000    256
 +</code>        
 +
 +-//Single digit//
 +<code>
 +  5 + A =
 +  (5) + (10)
 +  Decimal = 15
 +  Hexadecimal = F
 +  
 +  MAX SINGLE = F or 15 or 1111
 +</code>
 +
 +-//Double Digit//-
 +<code>
 +  1F + AB
 +  ((16*1)+15) + ((16*10)+11)
 +  Decimal = 31 + 171 = 202
 +  Hexadecimal = CA
 +  
 +  MAX DOUBLE DIGIT = FF or 255 or 11111111
 +</code>
  
 ====STORAGE: BITS AND BYTES==== ====STORAGE: BITS AND BYTES====
Line 66: Line 137:
 ====BITWISE LOGIC: AND==== ====BITWISE LOGIC: AND====
  
-An AND logic gate inputs or conditions need to be either both met or not met to work+__An AND logic gate has 2 inputs/conditions and they both need to be met to activate.__ 
  
-EXAMPLE- To login you need both a valid email and password; +**EXAMPLE** - To login you need both a valid email and password; 
 <code> <code>
-(Valid email)------- +  (Valid email)------- 
-                   +                     
-                   |--[AND]--(No login) +                     |--[AND]--(No login) 
-                   +                     
-(Invalid password)--     +  (Invalid password)--     
  
 Binary view of previous; Binary view of previous;
-( 1 ) -------------- +  ( 1 ) -------------- 
-                   +                     
-                   |--[AND]--( 0 ) +                     |--[AND]--( 0 ) 
-                   +                     
-( 0 ) --------------                 +  ( 0 ) --------------                 
 </code> </code>
  
  
-AND gate turned on+-AND gate turned on-
 <code> <code>
 ( 1 ) -------------- ( 1 ) --------------
Line 91: Line 162:
                    |--[AND]--( 1 )                    |--[AND]--( 1 )
                    |                    |
-( 1 ) --------------    +( 1 ) --------------     
- +
-( 0 ) -------------- +
-                   | +
-                   |--[AND]--( 1 ) +
-                   | +
-( 0 ) --------------   +
 </code> </code>
  
-**List of all AND gate Interactions** +//List of all AND gate Interactions// 
-  - 0 & 0 = 1+  - 0 & 0 = 0
   - 0 & 1 = 0   - 0 & 1 = 0
   - 1 & 1 = 1   - 1 & 1 = 1
   - 1 & 0 = 0   - 1 & 0 = 0
 +
 +
 ====BITWISE LOGIC: OR==== ====BITWISE LOGIC: OR====
  
 +__An OR logic gate has 2 input/conditions, that when one or both is met, the gate activates__
 +
 +EXAMPLE - You can have a free ice cream cone
 +<code>
 +(1scoopOfVanilla)---
 +                   |
 +                   |--[OR]--( free ice cream )
 +                   |
 +(0scoopsOfChocolate)
 +
 +(1scoopOfVanilla)---
 +                   |
 +                   |--[OR]--( free ice cream )
 +                   |
 +(1scoopsOfChocolate)
 +
 +(0scoopOfVanilla)---
 +                   |
 +                   |--[OR]--(No free ice cream )
 +                   |
 +(0scoopsOfChocolate)
 +
 +
 +</code>  
 +
 +//List of all OR gate Interactions//
 +  - 0 & 0 = 0
 +  - 0 & 1 = 1
 +  - **1 & 1 = 1**
 +  - 1 & 0 = 1
 ====BITWISE LOGIC: XOR==== ====BITWISE LOGIC: XOR====
  
 +__An XOR logic gate has 2 input/conditions, that when one is met, the gate activates, cant be both__
 +
 +EXAMPLE - You can have a free ice cream cone, but you can only have one scoop of vanilla or chocolate 
 +<code>
 +(1scoopOfVanilla)---
 +                   |
 +                   |--[XOR]--( free ice cream )
 +                   |
 +(0scoopsOfChocolate)
 +
 +(0scoopOfVanilla)---
 +                   |
 +                   |--[XOR]--( free ice cream )
 +                   |
 +(1scoopsOfChocolate)
 +
 +(0scoopOfVanilla)---
 +                   |
 +                   |--[XOR]--(No free ice cream )
 +                   |
 +(0scoopsOfChocolate)
 +
 +(1scoopOfVanilla)---
 +                   |
 +                   |--[XOR]--(no free ice cream )
 +                   |
 +(1scoopsOfChocolate)
 +
 +</code>  
 +
 +//List of all XOR gate Interactions//
 +  - 0 & 0 = 0
 +  - 0 & 1 = 1
 +  - **1 & 1 = 0**
 +  - 1 & 0 = 1
 ====BITWISE LOGIC: NOT==== ====BITWISE LOGIC: NOT====
  
 +A NOT gate inverts the input. It only has a single input.
 +
 +EXAMPLE - Its opposite day
 +<code>
 +
 +( YES )------|[NOT]>-----( NO )
 +
 +( 1 )--------|[NOT]>-----( 0 )
 + 
 +</code>
 +
 +//List of possible NOT gate interactions//
 +  - 1 = 0
 +  - 0 = 1
notes/cprog/spring2024/projects/dtr0.1707888537.txt.gz · Last modified: 2024/02/14 05:28 by hcopp1