• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 22:12
CET 04:12
KST 12:12
  • 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
ByuL: The Forgotten Master of ZvT0Behind the Blue - Team Liquid History Book16Clem wins HomeStory Cup 289HomeStory Cup 28 - Info & Preview13Rongyi Cup S3 - Preview & Info8
Community News
Weekly Cups (Feb 9-15): herO doubles up0ACS replaced by "ASL Season Open" - Starts 21/0224LiuLi Cup: 2025 Grand Finals (Feb 10-16)43Weekly Cups (Feb 2-8): Classic, Solar, MaxPax win2Nexon's StarCraft game could be FPS, led by UMS maker13
StarCraft 2
General
ByuL: The Forgotten Master of ZvT Weekly Cups (Feb 9-15): herO doubles up Nexon's StarCraft game could be FPS, led by UMS maker How do you think the 5.0.15 balance patch (Oct 2025) for StarCraft II has affected the game? StarCraft 1 & 2 Added to Xbox Game Pass
Tourneys
LiuLi Cup: 2025 Grand Finals (Feb 10-16) WardiTV Team League Season 10 PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar) $5,000 WardiTV Winter Championship 2026 StarCraft Evolution League (SC Evo Biweekly)
Strategy
Custom Maps
Map Editor closed ? [A] Starcraft Sound Mod
External Content
Mutation # 513 Attrition Warfare The PondCast: SC2 News & Results Mutation # 512 Overclocked Mutation # 511 Temple of Rebirth
Brood War
General
TvZ is the most complete match up Gypsy to Korea Which units you wish saw more use in the game? Ladder maps - how we can make blizz update them? BW General Discussion
Tourneys
[Megathread] Daily Proleagues Escore Tournament StarCraft Season 1 Small VOD Thread 2.0 KCM Race Survival 2026 Season 1
Strategy
Fighting Spirit mining rates Zealot bombing is no longer popular? Simple Questions, Simple Answers Current Meta
Other Games
General Games
Nintendo Switch Thread ZeroSpace Megathread Diablo 2 thread Path of Exile Battle Aces/David Kim RTS 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
TL Mafia Community Thread Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Ask and answer stupid questions here! Things Aren’t Peaceful in Palestine European Politico-economics QA Mega-thread
Fan Clubs
The IdrA Fan Club The herO Fan Club!
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books [Manga] One Piece Anime Discussion Thread
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
TL Community
The Automated Ban List
Blogs
The Search For Meaning in Vi…
TrAiDoS
My 2025 Magic: The Gathering…
DARKING
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1827 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
OSC
00:00
OSC Elite Rising Star #17.5
CranKy Ducklings155
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RuFF_SC2 228
Nathanias 78
StarCraft: Brood War
Artosis 714
sorry 94
NaDa 59
Noble 20
Light 0
Dota 2
monkeys_forever889
NeuroSwarm176
febbydoto19
LuMiX1
League of Legends
Trikslyr82
Counter-Strike
taco 446
m0e_tv418
adren_tv49
Other Games
summit1g12141
Day[9].tv767
JimRising 763
C9.Mang0567
KnowMe202
Maynarde143
WinterStarcraft61
ZombieGrub35
minikerr8
Organizations
Other Games
BasetradeTV142
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• HeavenSC 12
• Response 1
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Scarra1881
Other Games
• Day9tv767
Upcoming Events
WardiTV Winter Champion…
8h 48m
PiGosaur Cup
21h 48m
Replay Cast
1d 5h
WardiTV Winter Champion…
1d 8h
Replay Cast
1d 20h
PiG Sty Festival
2 days
Maru vs Bunny
Classic vs SHIN
The PondCast
2 days
KCM Race Survival
2 days
WardiTV Winter Champion…
2 days
OSC
2 days
[ Show More ]
Replay Cast
2 days
PiG Sty Festival
3 days
Clem vs Percival
Zoun vs Solar
Epic.LAN
3 days
Replay Cast
3 days
PiG Sty Festival
4 days
herO vs NightMare
Reynor vs Cure
CranKy Ducklings
4 days
Epic.LAN
4 days
Replay Cast
4 days
PiG Sty Festival
5 days
Serral vs YoungYakov
ByuN vs ShoWTimE
Sparkling Tuna Cup
5 days
Replay Cast
5 days
Replay Cast
6 days
Wardi Open
6 days
Replay Cast
6 days
Liquipedia Results

Completed

C-League Week 31
LiuLi Cup: 2025 Grand Finals
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
Nations Cup 2026
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025

Upcoming

Escore Tournament S1: King of Kings
[S:21] ASL SEASON OPEN 1st Round
[S:21] ASL SEASON OPEN 1st Round Qualifier
Spring Cup 2026: China & Korea Invitational
[S:21] ASL SEASON OPEN 2nd Round
[S:21] ASL SEASON OPEN 2nd Round Qualifier
Acropolis #4
HSC XXIX
uThermal 2v2 2026 Main Event
Bellum Gens Elite Stara Zagora 2026
RSL Revival: Season 4
WardiTV Winter 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
FISSURE Playground #3
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
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.