• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 11:10
CET 17:10
KST 01:10
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
[BSL21] Non-Korean Championship - Starts Jan 100SC2 All-Star Invitational: Jan 17-1819Weekly Cups (Dec 22-28): Classic & MaxPax win, Percival surprises2Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies3ComeBackTV's documentary on Byun's Career !11
StarCraft 2
General
SC2 All-Star Invitational: Jan 17-18 Weekly Cups (Dec 22-28): Classic & MaxPax win, Percival surprises Chinese SC2 server to reopen; live all-star event in Hangzhou Starcraft 2 Zerg Coach ComeBackTV's documentary on Byun's Career !
Tourneys
OSC Season 13 World Championship WardiTV Mondays $5,000+ WardiTV 2025 Championship $100 Prize Pool - Winter Warp Gate Masters Showdow Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 506 Warp Zone Mutation # 505 Rise From Ashes Mutation # 504 Retribution Mutation # 503 Fowl Play
Brood War
General
StarCraft & BroodWar Campaign Speedrun Quest A cwal.gg Extension - Easily keep track of anyone I would like to say something about StarCraft BGH Auto Balance -> http://bghmmr.eu/ (UMS) SWITCHEROO *New* /Destination Edit/
Tourneys
SLON Grand Finals – Season 2 [BSL21] Non-Korean Championship - Starts Jan 10 [Megathread] Daily Proleagues [BSL21] Grand Finals - Sunday 21:00 CET
Strategy
Simple Questions, Simple Answers Current Meta [G] How to get started on ladder as a new Z player Fighting Spirit mining rates
Other Games
General Games
Elden Ring Thread General RTS Discussion Thread Nintendo Switch Thread Awesome Games Done Quick 2026! Stormgate/Frost Giant Megathread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas Survivor II: The Amazon Sengoku Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Canadian Politics Mega-thread The Games Industry And ATVI 12 Days of Starcraft
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List TL+ Announced
Blogs
National Diversity: A Challe…
TrAiDoS
I decided to write a webnov…
DjKniteX
James Bond movies ranking - pa…
Topin
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 733 users

[help] Hamming Decoder

Blogs > Sinensis
Post a Reply
Sinensis
Profile Blog Joined April 2009
United States2513 Posts
March 02 2010 18:54 GMT
#1
I need to implement a Hamming Decoder using java. I'll explain the specifications:

I need to be able to input a 15-bit string, the program will then determine and output the nearest codeword then it will output the original 11-bit message; there will be at most 1 error that needs correcting.

(here is the parity check matrix for a [15,11] code:

[0 0 0 0 1 1 1 1 1 1 1 1 0 0 0
1 1 1 0 0 0 0 1 1 1 1 0 1 0 0
0 1 1 1 0 1 1 0 0 1 1 0 0 1 0
1 0 1 1 1 0 1 0 1 0 1 0 0 0 1]

)

Even some strong pseudocode would be of immense help and would help me better prepare for this exam. I will paypal someone 5, 10, or whatever appropriate amount of money as compensation.

*
538
Profile Blog Joined November 2008
Hungary3932 Posts
March 02 2010 20:03 GMT
#2
A homework thread, for money?
BW fighting!
cgrinker
Profile Blog Joined December 2007
United States3824 Posts
March 02 2010 21:01 GMT
#3
Check sum?
Hamming Distance?
Grey Code?
Homework?
wo0py
Profile Blog Joined July 2006
Netherlands922 Posts
March 02 2010 22:10 GMT
#4
As a student in information sciences, i reckognize homework when a blog is posted about it.
We shouldnt recreate anger of the non-virtual world
Mickey
Profile Blog Joined July 2005
United States2606 Posts
March 02 2010 23:02 GMT
#5
I don't think this is technically a homework thread. He's offering compensation and not depending on help for free.

It's more like he's offering someone a small job.
tec27
Profile Blog Joined June 2004
United States3702 Posts
Last Edited: 2010-03-02 23:39:11
March 02 2010 23:36 GMT
#6
http://en.wikipedia.org/wiki/Hamming_code#General_algorithm this can probably help you quite a bit. Obviously you'll have to reverse what they give a bit to figure out how to detect errors, but the table should be super-helpful for figuring that out. I think if you sit down and work through it manually and then write the code yourself, it'll be a lot more beneficial to you in the long run.

Edit: Also, notice that "Parity bit 1 covers all bit positions which have the least significant bit set: bit 1 (the parity bit itself), 3, 5, 7, 9, etc.". You can check such a condition with (position & 0x1). That should be helpful for looping through all the bits you need to check.

And moreover, this should help you with the process as well: http://en.wikipedia.org/wiki/Hamming_code#Hamming.2811.2C7.29_code
Can you jam with the console cowboys in cyberspace?
Sinensis
Profile Blog Joined April 2009
United States2513 Posts
Last Edited: 2010-03-02 23:57:18
March 02 2010 23:53 GMT
#7
On March 03 2010 08:36 tec27 wrote:
http://en.wikipedia.org/wiki/Hamming_code#General_algorithm this can probably help you quite a bit. Obviously you'll have to reverse what they give a bit to figure out how to detect errors, but the table should be super-helpful for figuring that out. I think if you sit down and work through it manually and then write the code yourself, it'll be a lot more beneficial to you in the long run.

Edit: Also, notice that "Parity bit 1 covers all bit positions which have the least significant bit set: bit 1 (the parity bit itself), 3, 5, 7, 9, etc.". You can check such a condition with (position & 0x1). That should be helpful for looping through all the bits you need to check.

And moreover, this should help you with the process as well: http://en.wikipedia.org/wiki/Hamming_code#Hamming.2811.2C7.29_code


Many thanks tec. I decided to skip a couple of my classes today to get this done and it wound up being easier than I anticipated. Wikipedia was exactly what I used too, the only difference is they mainly focus on [7,4] codes and mine had to be of variable length. It turns out there's a formula that easily derives the parity check matrix for any length. Once I found that it was easy.

I'll post it in case you were interested:
Code length: n = 2^m - 1
Dimension: k = 2^m - m - 1
Min distance: d = 3
Please log in or register to reply.
Live Events Refresh
Platinum Heroes Events
13:00
PSC2L Finals - Playoffs
Shameless vs GeraldLIVE!
RotterdaM980
Liquipedia
OSC
13:00
World Championship: Challenger
WardiTV847
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 980
Lowko568
BRAT_OK 65
MindelVK 29
RushiSC 28
StarCraft: Brood War
Horang2 2212
Jaedong 1652
EffOrt 831
Stork 649
Larva 603
Shuttle 555
Soma 498
Mini 497
ggaemo 373
Light 324
[ Show more ]
actioN 316
Hyun 260
ZerO 217
Hyuk 216
Sharp 214
Snow 207
Rush 204
firebathero 192
Barracks 143
hero 57
Sea.KH 54
JYJ 53
Killer 35
Terrorterran 30
Mong 27
PianO 24
Rock 20
yabsab 18
soO 15
ajuk12(nOOB) 12
Sacsri 10
HiyA 8
Shine 7
Dota 2
qojqva4689
singsing2430
Fuzer 273
League of Legends
C9.Mang0531
Counter-Strike
zeus729
Other Games
Grubby4112
Gorgc2278
hiko581
B2W.Neo479
FrodaN343
Hui .300
Mlord290
crisheroes286
Liquid`VortiX115
ArmadaUGS95
QueenE70
KnowMe69
ZerO(Twitch)28
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• HeavenSC 27
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• poizon28 0
• sooper7s
StarCraft: Brood War
• Michael_bg 2
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV706
• lizZardDota283
League of Legends
• Jankos2675
Upcoming Events
Korean StarCraft League
10h 51m
OSC
19h 51m
IPSL
21h 51m
Dewalt vs Bonyth
OSC
1d 1h
OSC
1d 19h
uThermal 2v2 Circuit
1d 21h
Replay Cast
2 days
Patches Events
3 days
OSC
3 days
OSC
4 days
[ Show More ]
OSC
5 days
Liquipedia Results

Completed

C-Race Season 1
WardiTV 2025
META Madness #9

Ongoing

IPSL Winter 2025-26
BSL Season 21
Slon Tour Season 2
CSL Season 19: Qualifier 2
Escore Tournament S1: W2
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025

Upcoming

CSL 2025 WINTER (S19)
Escore Tournament S1: W3
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Thunderfire SC2 All-star 2025
Big Gabe Cup #3
OSC Championship Season 13
Nations Cup 2026
Underdog Cup #3
NA Kuram Kup
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.