• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 14:22
CEST 20:22
KST 03:22
  • 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
Code S Season 1 (2026) - RO4 & Finals Preview5[ASL21] Ro4 Preview: On Course12Code S Season 1 - RO8 Preview7[ASL21] Ro8 Preview Pt2: Progenitors8Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun13
Community News
Weekly Cups (May 11-17): Classic wins double0Code S Season 1 (2026) - RO8 Results2Weekly Cups (May 4-10): Clem, MaxPax, herO win1Maestros of The Game 2 announcement and schedule !17Weekly Cups (April 27-May 4): Clem takes triple0
StarCraft 2
General
Weekly Cups (May 11-17): Classic wins double Code S Season 1 (2026) - RO4 & Finals Preview Team Liquid Map Contest #22 - The Finalists Code S Season 1 (2026) - RO8 Results Code S Season 1 (2026) - RO12 Results
Tourneys
Maestros of The Game 2 announcement and schedule ! $1,400 SEL Season 3 Ladder Invitational GSL Code S Season 2 (2026) GSL Code S Season 1 (2026) $5,000 WardiTV Spring Championship 2026
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players
External Content
The PondCast: SC2 News & Results Mutation # 526 Rubber and Glue Mutation # 525 Wheel of Misfortune Mutation # 524 Death and Taxes
Brood War
General
Lights Ro.8 Review (asl s21) 25 Years Since Brood War Patch 1.08 vespene.gg — BW replays in browser BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion
Tourneys
[ASL21] Semifinals B [BSL22] RO8 Bracket Stage + Another TieBreaker [ASL21] Ro8 Day 4 Escore Tournament StarCraft Season 2
Strategy
Muta micro map competition Fighting Spirit mining rates [G] Hydra ZvZ: An Introduction Simple Questions, Simple Answers
Other Games
General Games
Stormgate/Frost Giant Megathread Warcraft III: The Frozen Throne ZeroSpace Megathread War of Dots, 2026 minimalst RTS Nintendo Switch Thread
Dota 2
The Story of Wings Gaming
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 TL Mafia Community Thread Five o'clock TL Mafia
Community
General
US Politics Mega-thread European Politico-economics QA Mega-thread YouTube Thread Russo-Ukrainian War Thread UK Politics Mega-thread
Fan Clubs
The herO Fan Club!
Media & Entertainment
[Manga] One Piece Anime Discussion Thread [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread McBoner: A hockey love story Formula 1 Discussion
World Cup 2022
Tech Support
ETHEREUM RECOVERY ASSISTANCE streaming software Strange computer issues (software)
TL Community
The Automated Ban List
Blogs
Why RTS gamers make better f…
gosubay
How EEG Data Can Predict Gam…
TrAiDoS
ramps on octagon
StaticNine
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1845 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
Next event in 15h 8m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 540
elazer 209
BRAT_OK 122
SteadfastSC 117
UpATreeSC 85
JuggernautJason35
MindelVK 22
StarCraft: Brood War
Mini 516
ggaemo 288
firebathero 201
actioN 146
Dewaltoss 75
ToSsGirL 39
scan(afreeca) 35
Movie 32
Rock 23
ajuk12(nOOB) 9
Dota 2
Gorgc7664
qojqva1764
Counter-Strike
fl0m1970
Fnx 1778
byalli360
Heroes of the Storm
Liquid`Hasu144
Other Games
Grubby5402
FrodaN2083
Dendi476
ceh9460
B2W.Neo457
KnowMe196
C9.Mang0111
ArmadaUGS76
QueenE60
Trikslyr60
Organizations
Counter-Strike
PGL799
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 17 non-featured ]
StarCraft 2
• Reevou 6
• Dystopia_ 6
• Migwel
• AfreecaTV YouTube
• sooper7s
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• HerbMon 26
• 80smullet 14
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Other Games
• imaqtpie958
• WagamamaTV226
• Shiphtur196
Upcoming Events
GSL
15h 8m
Cure vs sOs
SHIN vs ByuN
Replay Cast
1d 5h
GSL
1d 15h
Classic vs Solar
GuMiho vs Zoun
WardiTV Spring Champion…
1d 16h
Replay Cast
2 days
Sparkling Tuna Cup
2 days
WardiTV Spring Champion…
2 days
Replay Cast
3 days
RSL Revival
3 days
Classic vs SHIN
Rogue vs Bunny
BSL
4 days
[ Show More ]
Replay Cast
4 days
Afreeca Starleague
4 days
Flash vs Soma
RSL Revival
4 days
BSL
5 days
Patches Events
5 days
Universe Titan Cup
5 days
Rogue vs Percival
Wardi Open
5 days
Monday Night Weeklies
5 days
Replay Cast
6 days
The PondCast
6 days
Kung Fu Cup
6 days
Liquipedia Results

Completed

Escore Tournament S2: W7
2026 GSL S1
Nations Cup 2026

Ongoing

BSL Season 22
ASL Season 21
IPSL Spring 2026
KCM Race Survival 2026 Season 2
Acropolis #4
KK 2v2 League Season 1
BSL 22 Non-Korean Championship
YSL S3
SCTL 2026 Spring
RSL Revival: Season 5
Heroes Pulsing #1
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2

Upcoming

Escore Tournament S2: W8
CSCL: Masked Kings S4
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
Maestros of the Game 2
WardiTV Spring 2026
2026 GSL S2
Bounty Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
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.