Image
 
linkedin_logo.png rss_logo.jpg
twitter_logo.png youtube_logo.jpg
Latest Additions
 
EH-Net Login
Welcome Guest.






Lost Password?
No account yet? Register
Who's Online
We have 49 guests online
 
Advertisement

You are here: Home arrow Ethical Hacking Discussions and Related Certificationsarrow Otherarrow 2's complement help
EH-Net
May 22, 2013, 03:16:24 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Go back to The Ethical Hacker Network Online Magazine Home Page
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: 2's complement help  (Read 5512 times)
0 Members and 1 Guest are viewing this topic.
ethicalhack3r
Full Member
***
Offline Offline

Posts: 139


View Profile WWW
« on: May 19, 2009, 05:44:28 AM »

Hello,
I had an exam this morning which had the following question:

What is the largest positive value that can be represented using a 16-bit 2's complement representation?

My answer was 32766

Im sure its wrong tho, any one know the real answer?
Logged
hayabusa
Hero Member
*****
Offline Offline

Posts: 1632



View Profile
« Reply #1 on: May 19, 2009, 09:21:21 AM »

Been a while since I've done this.  I think you're one shy, and the answer is 32767.

16-bit would be 1000000000000000, and flipping the bits would yield 0111111111111111, which is equal to 32767 decimal.

To support my thinking, I found the following:

"For instance, a 16-bit word can represent signed integers in the range −32 768 to + 32 767."

which I took from:

http://openlearn.open.ac.uk/mod/resource/view.php?id=175771

HTH.

(edit - please excuse me if I'm incorrect, and someone tell us otherwise...  been a LONG time since I'd done these, too)
« Last Edit: May 19, 2009, 09:29:41 AM by Hayabusa0194 » Logged

~ hayabusa ~ 

"All men can see these tactics whereby I conquer, but what none can see is the strategy out of which victory is evolved." - Sun Tzu, 'The Art of War'


OSCE, OSCP , GPEN, C|EH
ethicalhack3r
Full Member
***
Offline Offline

Posts: 139


View Profile WWW
« Reply #2 on: May 19, 2009, 12:39:53 PM »

I think your right because 0 is a positive number and I completely forgot about it.

Thanks for the help!  Smiley
Logged
jason
Hero Member
*****
Offline Offline

Posts: 1012



View Profile WWW
« Reply #3 on: May 19, 2009, 05:50:37 PM »

What was the subject matter of the test, out of curiosity?
Logged
ethicalhack3r
Full Member
***
Offline Offline

Posts: 139


View Profile WWW
« Reply #4 on: May 20, 2009, 06:11:14 AM »

Computer System Fundamentals

The whole module was based on the following book:
Fundamentals of Computer Architecture - Mark Burrell (2004)

http://www.amazon.co.uk/Fundamentals-Computer-Architecture-Mark-Burrell/dp/0333998669
Logged
Andrew Waite
Hero Member
*****
Offline Offline

Posts: 928



View Profile WWW
« Reply #5 on: May 20, 2009, 11:03:12 AM »

Ethicalhack3r,

The whole module was based on the following book:
Fundamentals of Computer Architecture - Mark Burrell (2004)

Just out of interest, was Mark Burrell also one of the module lecturers?
I remember some sleep-inducing lectures from him Cheesy

Andrew
Logged

ethicalhack3r
Full Member
***
Offline Offline

Posts: 139


View Profile WWW
« Reply #6 on: May 20, 2009, 04:20:08 PM »

He wasnt one of my lecturers but he used to lecture at Northumbria, think he left a couple of years ago maybe?!

I think its the logic gates that get me nodding off...
Logged
Andrew Waite
Hero Member
*****
Offline Offline

Posts: 928



View Profile WWW
« Reply #7 on: May 21, 2009, 12:59:40 AM »

Must have left after my days then, tbh think the whole module got me sleeping.

Wish I'd paid more attention now I'm playing with shellcode, turns out the low-level stuff is still relevant. Who'd of thought the lecturers would have a better understanding of the industry than the students? Smiley
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.054 seconds with 23 queries.
 
Exclusive Deal

sansfire13_245x90_cw90.jpg
SANSFIRE 2013
June 15 - 22

5% Off w/ Code: EHN_5

SANS Deals 4 EH-Netters
5% OFF Any SANS Course in Any Format!
Coupon Code: EHN_5 Including SANS Rocky Mountain 2013 & SANS Boston 2013
Polls
Compared to this year, 2013 will be:
 
Recent Forum Topics
EH-Net News Feeds
Latest Additions
 
         
Advertisement

© 2013 The Ethical Hacker Network
Joomla! is Free Software released under the GNU/GPL License.