SCD - 1.4.1 Data Types

?

T1 - Primitive Data Types, Binary and Hexadecimal

Primitive data type is provided by a programming language that are all held in binary and includes:

  • Integers - Whole Integers
  • Real/Float - Fractional Numbers
  • Boolean - True or False
  • Character - Letter, Number or Special Symbol
  • String - Anything encased in quote marks

Denary is refered to as base-10 (digits 0-9), binary is base-2 (0-1) and hex is base-16 (0-15)

Hex number system goes from 1-9 and then A-F (10-15)

e.g. 183 in hex - convert to binary = 1011 0111 then into hex, 1st part = 11 = B, 2nd part = 7 = 7 therefore 183=B7

1 of 13

T2 - Number Systems, ASCII and Unicode

Transistors are used to turn voltages on and off that act as switches where ON = 1 and OFF = 0

Inidvidual digit in a binary value is called a bit, these can then be combined into groups of 8 called bytes, for larger values numerical prefixes are applied to bytes

  • Kilobyte - kB = 1,000
  • Megabyte - MB = 1,000,000

However nowadays a base-2 multiplier is used instead of a base-10 (above) meaning that 1kB = 1024 Bytes which warrant a new set of prefixes

  • Kibibyte - KiB = 1,024
  • Mebibyte - MiB = 1,048,576
2 of 13

T2 - ASCII and Unicode

ASCII - American Standard Code for Information Interchange, ASCII was established to encode symbols in the english alpabet using a 7-bit character set giving 128 possible codes, due to this limit other languages and symbols cannot be represented. Symbols, uppercase and lowecase letters have their own unique values

Extended ASCII has an 8th bit added for extra characters/symbols (256 possible codes)

Unicode - Standardises encoding of characters from all languages which is done using either 16 or 32 bits, to improve adoption, the first 128 characters are the same as in the ASCII character set

Using Unicode means that there can be up to 4 bytes per character so file sizes are going to be much larger than using ASCII (4x). This however means that every character in every language, and every mathematical and scientific symbol, etc. can be represented.

3 of 13

T3 - Binary Arithmetic

When adding two binary numbers together, if a number is too large (1 already in the place) then the next bit is carried over, these are called carry bits and need to be shown above the calculation

As computers used a fixed number of bytes then an overflow error can occur when the result of the addition is too large for the nuumber of bits the computer works with.

Range of bits = 2x (X = number of bits) - 1 e.g. 24 - 1 = 15

Sign and Magnitude - Used to represent negative numbers in binary where the first bit acts as a sign bit where 0 = + and 1 = - , however binary arithmetic does not work when using this method

Two's Complement - used to represent negative values, similar to an analogue clock when turning back wheel from 1 it will equal 9999, a one in the first bit in 8-bit number = -128, used to ensure that subtraction occurs when adding negative values

Two's complement of a signed binary value (negative) is found by flipping all of the bits and adding one. Example: 77 = 01001101, flip = 10110010. add 1 = 10110011 = -77

This reduces the range, halving it. Maximum for 8 bits is 127 (01111111) and minimum is -128 (10000000)

4 of 13

T3 - More on Two's Complement & Binary Fractions

Two's complement can also encounter an overflow error when the result is too large to fit in the allocated number of bits as if it requires more bits the number will be incorrectly represented as a 1 in the leftmost bit inicates a negative number

Binary Fractions - Bits to the right of the notional point (indicates switch to fractions) indroduces fractional values represented in negative powers of 2 (0.5 > 0.25 > 0.0125 > etc. halving each time)

Fixed Point Binary - Uses a specified number of bits where the placement of the binary value is fixed e.g. if point is placed inbetween 4th and 5th bits in an 8-bit number then 6.625 as a fixed point binary would be 0110.1010, binary point can be placed anywhere

This increases accuracy as fractional points can be used but decreases range as the number of bits is still limited

5 of 13

T4 - Floating Point Arithmetic

Floating Point Numbers - Used with very large decimal values, held in the format Mx10n (M = mantissa, n = exponent)

12 bits are commonly used with the leftmost bit being a sign bit, the seven to the right being the mantissa (binary value) and the last 4 being the exponent (power)

  • Example - 0.1101100 0100 into denary assuming an 8-bit mantissa and 4-bit exponent:
  • Mantissa = 0.1101100 ,  Exponent = 0100 = 4 therefore binary point of mantissa is moved 4 places to the right, multiplying it by 24
  • Bianry Number = 01101.100 = 13.5

Floating point numbers can also be negative if they have a sign bit as one, in this case you would convert the mantissa into two's complement form and then apply the exponent

  • Example: 1.0010100 0011
  • Mantissa = 1.00101100 > 0.1101011 +1 = 01101100 in two's complement form
  • Exponent = 3, therefore binary point is moved 3 places to the right
  • 0110.1100 = -6.75   Don't forget to add back the negative sign
6 of 13

T4 - Negative Exponents & Noramlisation

Like in the mantissa the 1st bit of the exponent is a sign bit so a 4-bit exponent of 1000 is -8, to calculate the value of a negative exponent add the numbers so 1111 = -8 + 4 + 2 + 1 = -1

  • Positive Exponent - Binary point moved to the right
  • Negative Exponent - Bianry point moved to the left

Example: 0.1100000 1110 to denary

  • Mantissa = 0.1100000  |   Exponent = 1110 = -8 + 6 = -2
  • Binary point moved 2 places to the left = dividing by 4 or 22 or multiplying by 2-2
  • Binary Number = 0.0011000 = 0.125 + 0.0625 = 0.1875

Normalisation - Moving the binary point of a floating point number to provide maximum precision for a given number of bits. Example of this process - 0.1234567 x107 = 1,234,567 whereas 0.0012345 x109 = 1,234,500  < To normalise shift by 2 digits 

In normalised floating point form:

  • A positive number that has a sign bit of 0 MUST have the next digit as a 1
  • A negative number that has a sign bit of 1 MUST have the next digit as a 0
7 of 13

T4 - Normalising Postivive and Negative Binary

Example: Normalise the binary number 0.0011010 0100

  • Binary point needs to move 2 places to the right so that there is a 1 following the binary point
  • Pad with 0s at the righthand end, giving 0.1101000
  • To compensate for the larger mantissa, exponent must be made smaller
  • Subtract 2 from the exponent making it 0010
  • Normalised number is 0.1101000 0010

Normalising Negative Numbers - Follows the same process as normalising a positive binary number with the only difference being the a 0 MUST follow the 1 sign bit

  • Example: Normalise the number 1.1100011 0011
  • Move binary point 2 places right and subtract 2 from exponent = 111.00011 0001 which is the same as 1.0001100 0001

The number of 1's before a binary point in a negative number does not matter which is the same for leading 0's before a binary point in a positive number

8 of 13

T4 - Denary to Normalised Floating Point Binary

Example 1: 88 = 01011000

  • Move binary point 7 places left = 0.1011000 and set exponent equal to 7 = 0111
  • Number = 0.1011000 0111

Example 2: 17.25 = 010001.01

  • Move binary point 5 places left = 0.1000101 and set exponent equal to 5 = 0101
  • Number = 0.1000101 0101

For a negative number calculate two's complement before normalising

Example: -17.75

  • 17.75 = 01001.11 > 101110.00 > 101110.01
  • Move point 5 places left = 1.0111001 and set exponent equal to 5 = 0101
  • Number = 1.0111001 0101
9 of 13

T4 - Adding Normalised Numbers with Different Mans

For numbers that have different mansissa that need to be added, they need to have their mantissas equalised

Example: A =0.1100000 0001   B = 0.1111100 0011

  • Convert to fixed point and add: A = 1.1000   B = 111.1100  so sum = 1001.0100
  • As number is positive, sign bit will be zero
  • convert to normalised floating point = 0.1001010 0100

If needing to subtract a number from the other, find the two's complement of the number to be subtracted and then add together

10 of 13

T5 - Bitwise Manipulation and Masks

Logical shifts are used to examine the least/most significant bit, after operation the carry bit can be tested and a conditional branch executed

  • Logical Shift Right - Least significant bit (1st bit) shifted right into carry bit and a zero moves into the new space on the left (Dividing by 2 - Reduces accuracy)
  • Logical Shift Left - Most significant bit (8th bit) shifted left into carry bit and a zero moves into the new space on the right (Multiplying by 2)

Arithmetic shifts are used to multiply and divide by multiples on 2, by combining them two binary numbers can be multiplied together. When dividing a nymber by 2 it rounds down, this reduces accuracy as calculations such as 3/2 would equal 1

  • Arithmetic Shift Right - Same as logical shift right except for the new space has a 1 instead
  • Arithmetic Shift Left - Sign bit preserved and instead shifts the 2nd digit on the left into the carry bit where a zero then moves into the new space on the right

Example: Multiply 17 by 5 using shifts and addition

  • Multiply 17 by 1 = 0001 0001
  • Multiply 17 by 4 with 2 left shifts = 0100 0100
  • Add together = 0101 0101 = 85
11 of 13

T5 - Circular Shifts

Circular Shift Right with Carry - Carry bit is moved into the most significant bit (rightmost bit) and the least significant bit (leftmost bit) is moved into the carry bit (All bits move 1 bit to the right)

Circular Shift Left with Carry - Value in most significant bit is moved into the carry bit and the carry bit is moved into the least signinicant bit (Opposite process to right shift)

Example: Binary number 10011011 - arithmetica shift right 2 places then circular shift right by 1 place and multiply by 6

  • Arithmetic shift right by 2 places: 10011011 > 11100110 1
  • Circular shift right by 1 place: 11100110 1 > 11110011 0
  • Multiply by 4 = 1111001100
  • Multiply by 2 = 111100110
  • Add together = 10110110010 = 1458
12 of 13

T5 - Masks

Logical Instructions:

  • AND - Both statements must be true for the condition to be true
  • OR - Only one statement has to be truefor the condition to be true
  • XOR (Exclusive OR) - True if either input is true but not both

Masks - Used to manipulate bits by having an input which changes the output of the binary

  • AND - Used to clear a particular bit, leaving others unchanged, use a mask of 0 to clear a bit (make it a 0) and a mask of 1 to leave the bit unchanged
  • OR - Used to set a particular bit, leaving others unchanged, use a mask of 1 to set a bit (make it a 1) and a mask of 0 to leave it unchanged
  • XOR - Used to toggle a particular bit, leaving others unchanged, use a mask of 1 to toggle a bit (flip it to the other bit) and a mask of 0 to leave it unchanged
13 of 13

Comments

kanteno1

Report

Hello all my friends..

I'm Kante

I'm Selling CVV+cc Good US UK CA AU Japan France - Brazil Live fresh 100%

I have 7 experiences in carding activities

I have a large amount of spamming CVV+cc Fullz

CC Spamming Etc, Office, Airport...c.c

I currently have information about cc+ccv of USA- CANADA- UK- and Some BIN EUROPE

Mydetail: https://t.me/drkante22x

_________________ More Country CVV,CC Price List __________________

_Cvv Us Master - Visa 25$/per - Us Amex 30$/per

_Cvv UK Random 45/per - UK select bin 50$/per

_Cvv France International $45/per

_Cvv Italy International $45/per

_Cvv Denmark International $45/per

_Cvv Turkey International $45/per

_Cvv Canadian Master-Visa $35/per

_Cvv Australia Master-Visa 20$/per

-Cvv Brazil International $45/per

---------------------

-Sell INFO DOB + SSN + FINDRIVLICNO + NAME + ADDRESS GOOD WORK 100%

- Price :

500$ = 1k info ssn dob ( name + address + city + state + fone + ssn + dob + years SocialSecurityNumber

+ FinDrivLicNo + FinDrivLicState + FinDrivLicExpDate + HouseNumber + StreetName + AptNo + POBox )

Random STATE SSN DOB:

|WARREN|| GREEN|417253278|021374|5759036|2126|ROY WEBB RD|JACKSONVILLE|AL|36265|2564520376|

|jamey|w|bernecky|393806589|122065|20874399|1466|s pearl st|pageland|sc|29728|8436725329|

|audra|l|bates|426537799|102585|426537799|536|skul l creek rd|neely|ms|39461|6013945238|

|Robert|E|Sessoms|237026688|081055|28006988|910-531-44|193 Geneva Ln|Roseboro|NC|28382|9105314421|

===== UK DEAD with NiN ====

FULL NAME : DAWN ELAINE WILLIS

| DATE OF BIRTH : 19/10/1961

| ADDRESS : 2 MOORLANDS ROAD, BIRMINGHAM, B71 2EP

| PHONE : 07854594806

NATIONAL INSURANCE : WM 96 11 85 D

SEX: F

=== CANADA with SIN===

Milad Iranzadeh Boukani [email protected] 44 Romfield Circuit Thornhill ON CA L3T 3H3 06/07/1986 male 340994961

=== DL SCAN ===

Dl Scan Price 35$ per one

---------------------------------------

Similar Computing resources:

See all Computing resources »See all Binary resources »