< September 27 | Computing desk archive | September 29 > |
---|
| ||||||||
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions at one of the pages linked to above. | ||||||||
|
please answer the question with explanation
1>A DECIMAL NUMBER HAS 25 DIGITS.THE NUMBER OF BITS NEEDED FOR ITS EQUIVALENT BINARY REPRESENTATION ?
The precise answer for an unsigned 25-digit decimal integer N is : log2(N). However, what you probably meant is "what is the integer number of bits needed to represent the largest 25-bit decimal integer?" for this, the answer is rounded_up(log2(1025)), which is rounded_up(25*log2(10)) Arch dude 01:00, 15 October 2006 (UTC)
2>THE NUMBER OF INSTRUCTIONS NEEDED TO ADD n NUMBERS AND STORE THE RESULT IN MEMORY USING ONLY ONE ADDRESS INSTRUCTIONS
3>Let A be set having 'n' elements.the number of binary operation that can be defined on A ?
4>A certain machine uses expandind opcode.it has 16 bit instructions and 6bit addresses.it supports one address and two address instructions only.if there are'n' two address instructions,the maximum number of one address instruction is---?
5>A COMPUTER USES A FLOATING-POINT REPRESENTATION COMPRISING A SINGNED MAGNITUDE FRACTIONAL MANTISSA AND AN EXCESS-16 base-8 exponent.what decimal number is represented bya a floating-point number whose exponent is 10011,mantissa 101000,and sign bit set?
6>suppose the largest n-bit binary number requires 'd'digits in decimal representation.then what is the relations between 'n' and 'd'?
first of all this is not my home work,if you can solve this problem then it will be great help,because i am very weak in co,so please
Why do you say the first bit doesn't matter? How do you think the computer keeps track of sign? --frothT C 23:31, 28 September 2006 (UTC)
I use windows xp. When I leave the computer idle for 5 minutes, the keyboard stops functioning. The num lock light in the keyboard glows, but if I press any key, it does not function. I surely think something is fault with windows settings. But I dont know what settings I should try and change. Should I go for setup and try, or should I try doing in control panel? where exactly should I try changing settings?
Thank you
Hi:
How do I open the ".rs" files that contain screenshot images taken with Solaris's "snapshot" program? (Snapshot's interface seems to have that OpenWindows/OpenLook feel to it, so I surmise it's an ancient program).
Thanks,
129.97.252.227 17:39, 28 September 2006 (UTC)
I'm trying to do 3 things:
1) Run an executable from my program. 2) Wait for it to ask for input and feed it input. 3) Check its output (at this point the executable terminates on its own)
How can I do this with C++? Is there any way to stream it input without actually giving the exe window focus and simulating keypresses or something? Also I'm totally at a loss as to how to check its output. Also will any problems arise with it terminating on its own?
The exe is written in assembly if it makes any difference to the I/O.
Thanks --frothT C 21:20, 28 September 2006 (UTC)
pipe()
, dup2()
, fork()
, and exec*()
(see fork-exec). Basically you set up a pipe to communicate with yourself, then copy yourself (fork()
), then arrange for that pipe to be treated as standard input and output in one copy (dup2()
and close()
) and become the other program you want to execute (exec*()
). Then the parent process can just sit and act like the other program's keyboard and screen with its copy of the pipe.wait()
(or a variant) after the spawned processes die to clean them up. (It's okay to call wait()
before they actually die, so long as you're sure they will do so; your program will, well, wait for them to exit.)read()
and write()
with the pipes, you'll want to make streams for them. In C, you can always use fdopen()
, but there's no standard way to do it in C++ (aside of course from using the C library!). There are, however, common extensions to iostream
that let you open a file descriptor as a C++ stream object. --Tardis 22:38, 28 September 2006 (UTC)CreateProcess()
, declared in windows.h, with the STARTF_USESTDHANDLES flag set in the dwFlags member of the STARTUPINFO struct. The hStdInput and hStdOutput members should then be set to the reading and writing ends of two anonymous pipes, created with CreatePipe()
(note you'll probably also want to set the wShowWindow member to SW_HIDE to hide the child process' window as per your requirement, as well as setting the STARTF_USESHOWWINDOW flag). As per the documentation, for this to work the bInheritHandles parameter must be TRUE. ReadFile()
and WriteFile()
can be used to communicate over the pipe. More information is available from MSDN, however you may have trouble following it unless you are somewhat familiar with Windows systems programming.I have a 256MB SanDisk Freedom.
I would like to put a password on it, just so that when I plug it into either Windows or Mac OSX, I need to enter a password to access it.
My optimum budget for this would be $0
Any ideas would be greatly appreciated.
Omnipotence407 22:27, 28 September 2006 (UTC)