How to represent 256 values (0-255) in seven bits rather than 8 bits?
409160
This is possible only if at least half of those 256 values will not be used at all, and that you know which ones won't be used beforehand. If that's the case, you can map the remaining values that will be used with 7 bits.\n\nSee Shannon's entropy equation...
112055
Given an IP address A.B.C.D, the decimal form is:\nD + 256*C + 256*256*B + 256*256*256*A .
1152676
To write a very very very LARGE or SMALL decimal number
1134987
False. The range is the output, which will be a number, not a bit string.
97477
76063 in decimal\n0x1291F in Hexadecimal\n1001 0100 1000 11111 in binary
987865
256 * 5 =1280 \n\n1280 + 1500 = 2780\n\n2780 / 4 = 695\n\n695 - 7 = 688\n\nstarting # was 256
754844
8 bits = 1 byte\n1024 bytes = 1 kilobyte (kb)\n1024 kb = 1 Megabyte (Mb)\n1024 Mb = 1 Gigabyte (Gb)\n1024 Gb = 1 Terabyte (Tb)
314000
since they are all stored as binary all you need to do is display the results as either octal or decimal.\n//**************************************\n//INCLUDE files for :Convert Hex,dec,oct\n//**************************************\n#include <iostream.h>\n#include <conio.h> //for clrscr() & getche()func\n#include <stdlib.h> // for exit() function...\n//**************************************\n// Name: Convert Hex,dec,oct\n// Description:Converts an inputed number to Hex, dec, or oct.\nThe code was mainly written for education purposes.\n// By: Vagabond\n//\n//\n// Inputs:Inputs are from a main menu screen\n//\n// Returns:None\n//\n//Assumes:None\n//\n//Side Effects:None\n//This code is copyrighted and has limited warranties.\n//Please see http://www.Planet-Source-Code.com/xq/ASP/txtCodeId.10360/lngWId.3/qx/vb/scripts/ShowCode.htm\n//for details.\n//**************************************\n\n//****************************************************************************//\n// //\n// Program Name : ConvDec.cpp //\n// //\n// Programmer : Vagabond//\n//: Novice C++ //\n// //\n// Description : The user is asked to input a number in either Hex, Octal or //\n//Decimal, which is then converted to Hex, Octal & Decimal. //\n//The user can exit the program from the MAIN MENU or by//\n//the Escape key after each convertion.//\n// //\n//Compiler : Borland Turbo C++ v4.5.//\n// Date : 16/03/2006 //\n// //\n//****************************************************************************//\n#include <iostream.h>\n#include <conio.h>// for clrscr() & getche() functions...\n#include <stdlib.h> // for exit() function...\nconst int ESC = 27; // Used for escape sequince\nint main()\n\n\n    {\n    int key = 0;\n    int choise = 0;\n    long number;\n    while(key != ESC)\n\n\n        {\n        cout << "Choose Your Number Base&#92;n";\n        cout << "&#92;n&#92;t1. Hexadecimal.";\n        cout << "&#92;n&#92;t2. Octal.";\n        cout << "&#92;n&#92;t3. Decimal.";\n        cout << "&#92;n&#92;t4. Exit.&#92;n&#92;t";\n        cin >> choise;\n        switch(choise)\n\n\n            {\n            case 1: clrscr();\n             cout << "Enter a Hex number: ";\n             cin >> hex >> number;\n             cout << "&#92;n value in octal = "\n             << oct << number << endl;\n             cout << " value in decimal = "\n             << dec << number << endl;\n             break;\n            case 2: clrscr();\n             cout << "Enter a Octal number: ";\n             cin >> oct >> number;\n             cout << "&#92;nvalue in hex = "\n             << hex << number << endl;\n             cout << " value in decimal = "\n             << dec << number << endl;\n             break;\n            case 3: clrscr();\n             cout << "Enter a dec number: ";\n             cin >> dec >> number;\n             cout << "&#92;n value in octal = "\n             << oct << number << endl;\n             cout << "value in hex = "\n             << hex << number << endl;\n             break;\n            case 4: clrscr();\n             cout << "Program terminated by user...";\n             exit(0);\n             break; //Unreachable code.... \n            default : clrscr();\n             cout << "ERROR ~ Invalid selection&#92;n&#92;n";\n             break;\n            }\n            cout << "Press any key to continue or 'Esc' to exit";\n            key = getche();\n            clrscr();\n            }\n            cout << "Program terminated by user...";\n            return 0;\n
849879
here you go...\n(it'll work with up to 255 different disks, if you need more, you'll have to replace chars with ints)\n\nm1(char *a,b) {memove(b+1,b,strlen(b)+1); *b=*a; memmove(a+1,a, strlen(a);}\nm(char *a,b,c) {if (*a)  {m(a+1,b,c);m1(a,c);m(b,c,a);}
407425
8 bits = 1 byte\n1024 bytes = 1 KB(Kilo Bytes)\n1024 KB = 1 MB(Mega Bytes)\n1024 MB = 1 GB(Giga Bytes)\n1024 GB = 1 TB(Terra Bytes)
898742
It depends how many you put there.... You could for instance have an 8-bit grayscale JPEG, or a 24-bit full-colour JPEG. The bit depth isn't fixed.\n\nRawlyn.
278590
You ae confusing yourself!!! 0 - 255 is the range of ASCII characters. For eg. 65 stands for A and 97 stands for a and 1 stands for ☺. So you try 256 it will again display ☺ because there are only 255 characters. To know the value of an ASCII character press Alt + the req no. For eg Alt + 129 yeilds to ü. Go ahead try it yourself in any text editor. So a character variable can store only characters (ie. 0 - 255) NOTE:- Even all numbers are characters. Eg. Alt + 49 yeilds to 1 which is considered as a character. You know what I mean??? Don't you???
698756
First conversion the numbers to binary, then make the OR operation.\n\nExp.:\n8 OR 3.\n\nis: 1000 OR 11\n\n= 1011.\n\nWhich mean: 11 (Dec.)\n\nYou can use the Windows Calc.
968188
44.1 Ksamples/sec * 8 bits/samples = 352.8 bps
268949
It's just like the decimal system, only based on the number 2 instead of the number 10..........\n\n1  10  100  1000  10000  100000  1000000  etc... - Decimal\n\n1  2  4  8  16  32  64  128  256  512  1024  etc.. - Binary
274717
for( int i = 55; i > 0; i-- )\n  printf( "%d&#92;n", i );
1028015
When you get right down to the fundamentals, computers don't actually do anything with data.  Inside the processor, memory, buses and circuits all you really have are voltages - high voltages and low voltages.\n\nData representation is what these voltages actually mean to the outside world.  Normally these voltages are converted to a conceptual 1 or 0 and are then represented in binary.\n\nTake for example the 8-bit sequence 01000001.  What does it represent?  What does this mean?  Nothing - until we tell the computer what it's supposed to be.  If we say it's a letter then the computer will interpret this as an 'A'.  If we say it's a short (single byte) integer then it is 65.  On much older systems it could be an instruction, or a colour for a graphics system to deal with.\n\nOn modern systems the numbers are usually much longer.  Most modern systems are 32-bit, so the basic integer it deals with is 32 bits long.  The IEEE standard for floating point numbers defines a single precision number at 16 bits and a double precision at 32 bits.